Hibernate Tips: Easiest way to manage bi-directional associations
|

Hibernate Tips: Easiest way to manage bi-directional associations

Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please leave a comment below. Question: Updating both ends of a bidirectional association is an error-prone task. What’s the best way to implement it in…

Hibernate Tips: How to avoid Hibernate’s MultipleBagFetchException

Hibernate Tips: How to avoid Hibernate’s MultipleBagFetchException

Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please leave a comment below. Question: You explained that I should use a JOIN FETCH clause to initialize all associations of my entity that I…

Hibernate Tips: How to use an ORDER BY clause in a CriteriaQuery
|

Hibernate Tips: How to use an ORDER BY clause in a CriteriaQuery

Hibernate Tips is a series of posts in which I describe a quick and easy solution for common Hibernate questions. If you have a question for a future Hibernate Tip, please leave a comment below. Question: How do I create a CriteriaQuery which returns the selected entities in the ascending order of an attribute?