We are a new startup and decided to try jOOQ instead of JPA in the backend of our first product and we haven’t regretted it so far. We wrote a blog post summarizing our experiences and thoughts with jOOQ here.
The biggest minus with using jOOQ so far has been the “join deduplication boilerplate” issue I mention in the blog post.
Does my suggestion of adding some basic association support between the generated Record types make sense to anyone else? E.g. using my blog example: that a CustomerRecord can hold a list of OrderRecords?
The next step would then be that I could automagically convert a Result of a CUSTOMER.leftJoin(ORDER) query into CustomerRecords with the orders populated. Currently I have to write this logic myself, repeatedly in slight variations and it feels like it's boilerplate that could perhaps come with the library. Looks like at least some of the Python ActiveRecord implementations support associations to some extent (SQLObject, SQLAlchemy). I'm not looking for automatic fetching of associations (and the can of worms that comes with), just something that would simplify the step of converting JOIN results into Records with associations.
Regards,
Oskar Norrback
The Importance of Ordering
A query which makes use of subqueryload() in conjunction with a limiting modifier such as Query.first(),Query.limit(), or Query.offset() should always include Query.order_by() against unique column(s) such as the primary key, so that the additional queries emitted by subqueryload() include the same ordering as used by the parent query. Without it, there is a chance that the inner query could return the wrong rows
--
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 jooq-user+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
class Author {// The author nameString name;// The books he's writtenBook[] books;// The films he's writtenFilm[] films;}
SELECT * FROM author WHERE [ some predicate ]SELECT * FROM book WHERE author_id IN (SELECT id FROM author WHERE [ some predicate ])SELECT * FROM film WHERE author_id IN (SELECT id FROM author WHERE [ some predicate ])
SELECTMULTISET(SELECT * FROM book WHERE author_id = a.id) booksMULTISET(SELECT * FROM film WHERE author_id = a.id) filmsFROMauthor aWHERE[ some predicate ]