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?

Hibernate Tips: How to Share the Primary Key in a One-to-One Association
|

Hibernate Tips: How to Share the Primary Key in a One-to-One Association

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: I need to map a one-to-one association in which the primary key value of one entity is also used…

How to Choose the Most Efficient Data Type for To-Many Associations – Bag vs. List vs. Set

How to Choose the Most Efficient Data Type for To-Many Associations – Bag vs. List vs. Set

Which data type should you use to map a to-many association with Hibernate? Is it better to use a Set or a List? That’s a very common question, and most developers are surprised when they look at the documentation and find out that these are not the only options. You can also use a Bag…