Re:Problems with JPA/Hibernate
by amenghra on Monday April 12, 2021 @12:32AM
(#26776076)
I solve Hibernate problems by using jOOQ instead. The migration more than paid off the couple times I did it.
[ Parent
| on HN ]
Re:Problems with JPA/Hibernate
by ChrisWreck on Monday April 12, 2021 @05:30AM
(#26777472)
How do you solve storing/updating/removing child entities of another entity (which also may be a child of another entity) effectively?
I use jOOQ as well, but mostly only for the reading part. For the above case, I still use Hibernate, as I've yet to find an efficient way to do it in jOOQ.
Even Lukas Eder, the creator of JOOQ, suggests to use Hibernate for CRUD and JOOQ for querying:
https://blog.jooq.org/2015/03/24/jooq-vs-hibernate-when-to-c...
My models have always been fairly simple with not too many levels of child entities. I contain all the logic for a given entity in a single class (where I hand write the code to update related entities). I do have to keep my fingers crossed that nobody will implement similar-but-wrong logic in some other spot in the codebase. The 1:1 mapping between entities and classes to CRUD helps to some degree.