-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: List containing null values with joined-subclass
PostPosted: Thu Sep 16, 2004 4:50 am 
Beginner
Beginner

Joined: Thu Sep 16, 2004 4:36 am
Posts: 22
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.