detlev wrote:
Hi,
List ships = session.createCriteria(Ship.class) .createAlias("relations", "r").add(Restrictions.eq("r.ship", firm)).list();
I made a mistake in my above message:
List ships = session.createCriteria(Ship.class).createAlias("relations", "r").add(Restrictions.eq("r.firm", firm)).list();
r relates to table firmtrade or better class FirmTrade with attributes firm, ship, ownerfrom (date), owneruntil (date)
And have a firm a ship sold and then the same again bought, I have with my query this ship double.
Is it possible with Hibernate to return unique sets?