The join from A -> B is optional and the join from B -> C is not optional.
Joining from a to b and b.c ... then the outer join should cascade and both joins should be left outer joins.
The bug is that the second join is not an outer join and should be.
public void test() { Query<EOptOneA> query = Ebean.find(EOptOneA.class) .join("b") .join("b.c"); query.findList(); String sql = query.getGeneratedSql(); Assert.assertTrue(sql.contains("left outer join eopt_one_b")); Assert.assertTrue(sql.contains("left outer join eopt_one_c ebc")); }
Added a test that reproduces the problem.