Introduction In this article, you are going to learn why overwriting entity collections is an anti-pattern and how you can merge collections both effectively and efficiently with JPA and Hibernate. The reason I decided to write this article is that I’ve been this question asked over and over and over again.
Introduction Have you ever wondered how to clone an entity with JPA or Hibernate? Recently, I stumbled upon this Hibernate forum question and it reminded me that this was a common requirement when working with JPA and Hibernate. In this article, we are going to see the best way to clone a JPA entity with JPA and Hibernate.
Introduction In this article, you are going to learn how to map a JPA entity to the ResultSet of a SQL query using the @Subselect Hibernate-specific annotation.