I have 2 entities as Parent and Child as OneToMany relation as
@Entity public class Parent { @Id @GeneratedValue(strategy = GenerationType.AUTO) private Integer
To give you a hint, it's mainly for performance reasons, you can start reading the following links:
Second Level Cache
Hibernate Documentation