title: Play Framework 2.1 and Ebean: model Finder returns no data
body: <p>I've been banging my head around this for hours. I have two models:</p>
  
  <pre><code>@Entity
  @Table(name = "app_user")
  public class AppUser extends Model {
  
      @Id
      Long id;
  
      …
  
      @Constraints.Required
      @Valid
      @OneToOne(cascade = CascadeType.ALL, optional = false)
      public LocationAddress address;
  
      @Valid
      @OneToOne(cascade = CascadeType.ALL, optional = true)
      public LocationAddress addressBilling;
  
      …
  
  }
  
  @Entity
  @Table(name = "location_address")
  public class LocationAddress extends Model {
  
      @Id
      Long id;
  
      @Constraints.Required
      @Constraints.MaxLength(TextSize.DEFAULT)
      @Column(length = TextSize.DEFAULT, nullable = false)
      public String street;
  
      @Constraints.MaxLength(TextSize.TINY)
      @Column(length = TextSize.TINY)
      public String streetNo;
  
      @ManyToOne(cascade = CascadeType.PERSIST, optional = false)
      public Country country;
  
      …
  
      @OneToOne(mappedBy = "address")
      public AppUser userAddress;
  
      @OneToOne(mappedBy = "addressBilling")
      public AppUser userAddressBilling;
  
      @OneToOne(mappedBy = "address")
      public AdvertisingLocation advertisingLocationAddress;
  
      // -- Queries
  
      public static Finder&lt;Long, LocationAddress&gt; find = new Finder&lt;Long, LocationAddress&gt;(Long.class, LocationAddress.class);
  
      public static List&lt;LocationAddress&gt; all() {
          return find.all();
      }
  
      public static LocationAddress findById(long id) {
          return find.byId(id);
      }
  
  }
  </code></pre>
  
  <p>The problem is that <code>LocationAddress.all()</code> returns nothing, and thus <code>AppUser.findById(1).address.street</code> throws <code>EntityNotFoundException: Bean has been deleted - lazy loading failed</code>. Needless to say, the database table is not empty.</p>
  
  <p>Interestingly, <code>Ebean.find(LocationAddress.class).findRowCount()</code> returns 3 (this is correct).</p>
  
  <p>Anyone seeing what could be the issue? Thank you.</p>