Hibernate version:
2
Mapping documents:
i'm not allowed to post them online sorry
Code between sessionFactory.openSession() and session.close():
query q = session.createQuery("select sp from " +
"ServiceProviderTypeImpl as sp inner join fetch sp.serviceIDInternal si " +
" where si.value=:val");
q.setString("val", "00020020");
List l = q.list();
ServiceProviderTypeImpl st = (ServiceProviderTypeImpl) l.get(0);
Name and version of the database you are using:
postgresql 7.4.5
problem now is that the query works, as long as 1 set my where to return the first child in the database.
The query above does work and does return a ServiceProviderTypeImpl.
But the list containing the ServiceID's has 2 elements it says, the element 0 is null and the element 1 is valid.
If i change the si.value so it returns the first ServiceID then the list has 1 element with 0 being valid.
Is this normal behaviour? Returning null values if the child doesn't apply to the where clause?
thank you for helping me.
I'm sorry i cannot provide detailed information, but i'm not allowed to.
|