2 ms·
This implicit JOIN feature is already present in HQL and also in Jooq. It's very convenient, especially when you use a star-like table structure where the impor
by maweki 2y ago
This implicit JOIN feature is already present in HQL and also in Jooq. It's very convenient, especially when you use a star-like table structure where the important data table is basically just IDs and references.
https://www.jooq.org/doc/latest/manual/coming-from-jpa/from-jpa-implicit-join/ https://www.jooq.org/doc/latest/manual/coming-from-jpa/from-...
- twic 2y agoYes, this is a lot like path expressions in HQL / JPQL. There is a key difference, i think - in JPA land, relationships between classes are named at both ends. So an OrderDetail has an "Order order" field, but an Order also has a "Set<OrderDetail> details" field. That means you already have a name to use when going from an order to its details - you can say "sum(order.details.price)". Whereas the language in the article has to make it implicit, with (IMHO weird!) syntax like "OrderDetail.sum(price)". This starts to hurt more when you have multiple collections of the same type on an entity. Consider: City city_id Person birth_city_id residence_city_id What would SELECT city_id, Person.COUNT() FROM City do here?