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…

Hibernate Tips: What’s the Difference Between @Column(length=50) and @Size(max=50)

Hibernate Tips: What’s the Difference Between @Column(length=50) and @Size(max=50)

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: Some of our entity attributes are annotated with @Column(length=50), others with @Size(max=50) and others with both of these annotations….

Hibernate Tips: How to perform different validations for persist and update

Hibernate Tips: How to perform different validations for persist and update

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: I’m using BeanValidation to validate my entities automatically before they get persisted and updated. I defined different ValidationGroups for…

Hibernate Tips: SINGLE_TABLE strategy without discriminator column

Hibernate Tips: SINGLE_TABLE strategy without discriminator column

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: I need to map tables of a legacy database using the SINGLE_TABLE strategy. But these tables don’t contain a…