s.clear();
Query q = s.createQuery("select distinct a.zoo from Animal a where a.zoo is not null");
Type type = q.getReturnTypes()[0];
assertTrue( type instanceof ManyToOneType );
assertEquals( ( (ManyToOneType) type ).getAssociatedEntityName(), "org.hibernate.test.hql.Zoo" );
zoo = (Zoo) q
.iterate().next();
assertEquals( zoo.getMammals().size(), 1 );
assertEquals( zoo.getAnimals().size(), 1 );
s.clear();
s.delete(plat);