Could this be a possible enhancement?
Consider the following syntax (or something similar, the assignment of a specific alias is the key):
Query query = Ebean.find(Asset.class) .join("attributes", "attributes.definitionId, attributes.value", "a1") .join("attributes", "attributes.definitionId, attributes.value", "a2") .where() .eq("a1.definitionId", 57L) .eq("a1.value", "Quux") .conjunction() .eq("a2.definitionId", 56L) .eq("a2.value", "Foo") .query();
https://groups.google.com/forum/?fromgroups#!topic/ebean/7S6xWMIzNF4