java - tutorial - mybatis vs hibernate
JOOQ vs Hibernate (1)
When I chat to stackoverflowers on chat and read other tutorials about database with Java then they are guide me to use JOOQ instead of HIBERNATE.
I am totally aware about ORM with Hibernate and I prefer to use Hibernate and now aware almost about JOOQ by reading tutorials and implementation on small projects.
But I am confused what to choose and what is perfact for my dynamic web-applications which can be larger,medium or smaller, either Hibernate or JOOQ ?
Which one is best for different conditions and situations for developer.?
While jOOQ and Hibernate compete for the same target audience, they do not solve the same problem at all. You've already linked this article in your question. The essence of it is simple:
- Are you going to solve object graph persistence problems? Use an ORM (e.g. Hibernate)
- Are you going to embed SQL into Java? Use SQL (e.g. jOOQ)
Of course, since both APIs cover accessing relational databases, they overlap in functionality to a certain extent. E.g. Hibernate also supports simple querying, while jOOQ also supports simple mapping.
While we should avoid delving into subjective discussions about whether object graph persistence or SQL is a better approach at interacting with your database, I think the above is a pretty objective answer to what API is better suited, once you've made the subjective decision.
AND: You can use both, e.g. ORM/Hibernate for CRUD, SQL/jOOQ for reporting.
(Disclaimer: I work for the company behind jOOQ, so this answer is biased)