Hibernate Tip: How does Hibernate’s native ID generator work

Hibernate Tip: How does Hibernate’s native ID generator work

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 post a comment below. Question: One of the readers of my article about using Hibernate with a MySQL database asked the following question: What is…

5 Primary Key Mappings for JPA and Hibernate Every Developer Should Know

5 Primary Key Mappings for JPA and Hibernate Every Developer Should Know

Mapping a primary key column with JPA and Hibernate is simple. You just need to add an attribute to your entity, make sure that its type and name match the database column, annotate it with @Column and you’re done. You can then use the primary key to load the entity, and Hibernate sets the primary…

Localized Data – How to Map It With Hibernate

Localized Data – How to Map It With Hibernate

Internationalization not only affects the UI. If your application stores user-generated data and supports multiple languages, you also need a way to store different translations in your database. Typical examples are: market places that allow you to provide product descriptions in various languages, travel sites that offer trips to people all over the world and…