thanks for the answer. I couldn't test it allready (tomorrow), but i think this i not that, what I like to have.
Don't I need to write crit before:
Code:
.createCriteria("avenues","a")
Code:
crit.createCriteria("avenues","a")
Is this...
Code:
.add(Restrictions.or(
Restrictions.eq("c.id", "a.avenueId"),
Restrictions.eq("c.id", "b.buildingId")
not a restriction for the city? I need a restriction for the set avenues and the set buildings. The query should read all cities which contains a building with the id buildingId or a avenue with the id anvenueId?
I think that could be the solution:
Code:
Criteria crit = session.createCriteria(City.class,"c");
.createCriteria("avenues","a")
.createCriteria("building","b")
.add(Restrictions.or(
Restrictions.eq("a.id", avenueId),
Restrictions.eq("b.id", buildingId)
).list();
thanks!
poffi