title: Hibernate and SQL join types
body: <p>I have a simple JPA entity (hibernate implementation) with an eagerly fetched relationship:</p>
  
  <p><strong>User.java:</strong></p>
  
  <pre><code>@Entity
  @Table(name = "USER")
  public class User {
  
      @OneToOne(optional=false)
      @JoinColumn(name = "USER_STATUS_ID", nullable = false)  
      private UserStatus userStatus;
  </code></pre>
  
  <p><strong>UserStatus:</strong></p>
  
  <pre><code>@Entity
  @Table(name = "USER_STATUS")
  public class UserStatus {
  
      @Column(name = "name", nullable = false)
      private String name;
  </code></pre>
  
  <p>and the query that is being generated to lookup the entity looks something like this:</p>
  
  <pre><code>...from user left outer join user_status on...
  </code></pre>
  
  <p>My question is: why is Hibernate performing this outer join and not an inner join (since I've told it that it's not nullable or optional).  Is there any way to force an inner-join?</p>
  
  <p>Thanks.</p>