Hibernate performs twice the same query if a bidirectional relationship is defined
问题 I'm using Hibernate 4.3.8.Final and Oracle 11g database. I defined a very simple bidirectional relationship between two entities, named Parent and Child, as follows (getters and setters are omitted): @Entity public class Parent { @Id private Long id; @OneToOne(mappedBy="parent",fetch=FetchType.LAZY) private Child child; } @Entity public class Child { @Id private Long id; @OneToOne(fetch=FetchType.EAGER) @JoinColumn(name="PARENT_ID") private Parent parent; } The SQL code which generates the