title: Hibernate generates multiple select statements
body: <p>Not getting why multiple selects are needed, here are the classes</p>
  
  <pre><code>DrivingLicense.java
  @Entity
  @Table(name = "DRIVING_LICENSE")
  public class DrivingLicense {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "LICENSE_NUMBER")
      private int licenseNumber;
      @Column(name = "DATE_OF_ISSUE")
      private Date dateOfIssue;
  
      @OneToOne(mappedBy = "drivingLicense", cascade = CascadeType.ALL)
      private Person person;
  }
  
  Person.java
  @Entity
  @Table(name = "PERSON")
  public class Person {
      @Id
      @GeneratedValue(strategy = GenerationType.AUTO)
      @Column(name = "PERSON_ID")
      private int personId;
      @Column(name = "PERSON_NAME", nullable = false, length = 30)
      private String personName;
  
      @OneToOne(cascade = CascadeType.ALL)
      @JoinColumn(name = "D_LICENSE_NUMBER")
      private DrivingLicense drivingLicense;
  }
  
  TestClass
  
  TypedQuery&lt;Person&gt; query = entityManager.createQuery("from Person p", Person.class);
  query.getResultList();
  </code></pre>
  
  <p>here <code>query.getResultList</code> is generating following sqls</p>
  
  <pre><code>Hibernate: select person0_.PERSON_ID as PERSON_ID1_1_, person0_.D_LICENSE_NUMBER as D_LICENSE_NUMBER3_1_, person0_.PERSON_NAME as PERSON_NAME2_1_ from PERSON person0_
  Hibernate: select drivinglic0_.LICENSE_NUMBER as LICENSE_NUMBER1_0_0_, drivinglic0_.DATE_OF_ISSUE as DATE_OF_ISSUE2_0_0_, person1_.PERSON_ID as PERSON_ID1_1_1_, person1_.D_LICENSE_NUMBER as D_LICENSE_NUMBER3_1_1_, person1_.PERSON_NAME as PERSON_NAME2_1_1_ from DRIVING_LICENSE drivinglic0_ left outer join PERSON person1_ on drivinglic0_.LICENSE_NUMBER=person1_.D_LICENSE_NUMBER where drivinglic0_.LICENSE_NUMBER=?
  Hibernate: select person0_.PERSON_ID as PERSON_ID1_1_1_, person0_.D_LICENSE_NUMBER as D_LICENSE_NUMBER3_1_1_, person0_.PERSON_NAME as PERSON_NAME2_1_1_, drivinglic1_.LICENSE_NUMBER as LICENSE_NUMBER1_0_0_, drivinglic1_.DATE_OF_ISSUE as DATE_OF_ISSUE2_0_0_ from PERSON person0_ left outer join DRIVING_LICENSE drivinglic1_ on person0_.D_LICENSE_NUMBER=drivinglic1_.LICENSE_NUMBER where person0_.D_LICENSE_NUMBER=?
  </code></pre>
  
  <p>why 2 selects are needed I don't know. in both the table there is only one record.</p>