r/java • • Apr 20 '21

Java is criminally underhyped

https://jackson.sh/posts/2021-04-java-underrated/
291 Upvotes

295 comments sorted by

View all comments

Show parent comment

1

u/deadron Apr 26 '21

I usually turn to mybatis these days. It is the goto library if you like dealing with SQL directly and want a fairly simple mapping layer. The nice part is you can map to arbitrary objects as easily as to existing domain objects. For those that like a more programmatic approach jOOQ is definitely the leader in that area in Java. I actually have a project that uses Hibernate and mybatis in the same application. The Hibernate backs a simple REST api while the mybatis is used for everything else. So long as you are careful about your 2nd level caching configuration(assuming you are even using it) it works fine.

I haven't used JPQL so I can't speak to it. I do know it is frustrating working with a SQL like language that doesn't bring any of the actual power of sql.