Map Associations with JPA and Hibernate – The Ultimate Guide
| |

Map Associations with JPA and Hibernate – The Ultimate Guide

Association mappings are one of the key features of JPA and Hibernate. They model the relationship between two database tables as attributes in your domain model. That allows you to easily navigate the associations in your domain model and JPQL or Criteria queries. JPA and Hibernate support the same associations as you know from your…

Mapping Definitions in JPA and Hibernate – Annotations, XML or both?
|

Mapping Definitions in JPA and Hibernate – Annotations, XML or both?

If you’re using Hibernate for several years, you might remember the time when you had to define all your mappings in the orm.xml file. You had a bunch of Java classes that represented your domain model and a long XML file with the mapping and query information. One of the main challenges with that approach…

Hibernate Tips: How to validate that an entity attribute value is within a defined range

Hibernate Tips: How to validate that an entity attribute value is within a defined range

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 you like me to answer, please leave a comment below. Question: The value of one of the attributes of my entity has to be within a defined range. What is…

8 Ways to use the features of your database with Hibernate
| |

8 Ways to use the features of your database with Hibernate

A common misconception when working with Hibernate is that you can only map database tables and don’t use any other database features. That’s not the case, as I want to show you in this post. You can also use lots of other features which allow you to: Map read-only database views Call database functions Execute…