Hi Prasath, 

I work on a large project using both hibernate and jooq. 

Hibernate is used when:
* we need to save/update/delete an entity
* fetch entities objects

We use QueryDSL to create custom query to retrieve complex objects graph. 

jooq is used when:
* to overcome QueryDSL limitations
* to overcome ORM constraints: reports or complex queries do not fit well in 
entity based world 

A quick strategy I use to choose between  hibernate and jooq is:

If I need to present data to the user like a query result, with zero o few 
business logic on top of it AND I don't need to have an entity to work with I 
choose for jooq. 

If I need an entity I use pure hibernate or QueryDSL. 

I usually don't use jooq to fetch data and fill hibernate entity pojo, or when 
I do that entity is very simple. 

We experienced to use jooq also for non trivial entity fetch and mapping the 
result into entity graph, but we realize that we need too much effort to do 
that and than we discovered QueryDSL :p

Regarding datasource: I  share same datasource between hibernate and jooq. 
Seems quite reasonable to me use database permission to separate 
functionalities, not technology framework database access but if you need to do 
that you can follow Lukas tips. 

Regards 
Daniele

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to