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…

Hibernate Tips: What’s the Difference between JOIN, LEFT JOIN and JOIN FETCH
|

Hibernate Tips: What’s the Difference between JOIN, LEFT JOIN and JOIN FETCH

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 saw JPQL queries using JOIN, LEFT JOIN and JOIN FETCH statement. What are the differences between these 3…

Getting Started With Hibernate
| |

Getting Started With Hibernate

Hibernate is a very popular implementation of the Java Persistence API (JPA) standard. It acts as an additional layer on top of JDBC and enables you to implement a database-independent persistence layer. Hibernate provides an object-relational mapping implementation that maps your database records to Java objects and generates the required SQL statements to replicate all operations to the database. Let’s…