Overview @ManyToOne and @OneToMany are standard mappings in Hibernate. Understanding how to use them correctly is the key to mapping entities efficiently in Hibernate. In this post, I will show […]
Using @ColumnTransformer In Hibernate
Overview One of the lesser-known yet powerful annotations in Hibernate is @ColumnTransformer. This annotation let us apply SQL transformations on entity properties when interacting with the database. You can think […]
Why does Hibernate Need A No-arg constructor
Overview In this post, we are going to explore the reasons why does Hibernate need a no-arg constructor. The no-arg constructor need to be protected or public. A primer on […]
How To Map String To Boolean in Spring Data JPA
Overview There are times you work with legacy databases that store boolean values as strings. Let’s consider this example: Town A conducted a survey to see if their citizens like […]
Using SecondaryTable For Flexible Database Design (With example)
Let’s consider an example. You have been working on a website selling phones since 2000. In early 2000, there wasn’t any smartphone so you may created an object Phone like […]