-->
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.  [ 4 posts ] 
Author Message
 Post subject: hql size seems not to be consistent with size() method
PostPosted: Mon Apr 05, 2004 5:37 pm 
Newbie

Joined: Mon Apr 05, 2004 3:06 pm
Posts: 2
First of all thanks for your work, it has been really useful for me.
Making tests i've noticed an inconsistentcy between size keyword of hql and size method of hibernate lists.

Let me introduce the case, making test i accidentally added rows to a collection without respecting the correlative index field.

When executing the test i've noticed that the List.size() method was returning one unit more than the size in hql, i didn't understand at the begining but few minutes later i saw that what was happening is that the hibernate list was considering as null the missing indexes, this seems to be ok but if this is the case shoudn't the size keyword consider this elements too?

I think size of HQL should return max() of the index field of the collection plus one instead the count of the rows.

do you agree?
should i add a new issue in jira?

On the other hand I voted for a related issue really important to me, which is the posibility of filter collections of composites.

thank you very much in advance

Andr


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 07, 2004 6:03 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Unfortunatly HQL size() refer to the SQL semantic and thus may be inconsistant with list semantic.
Add it to JIRA but I'm not sure it will be accepted.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Apr 07, 2004 3:07 pm 
Newbie

Joined: Mon Apr 05, 2004 3:06 pm
Posts: 2
Thanks for the response but i've got another question:

but what would be the form of getting the size without initializing the list otherwise?
is there someone planning to work with issue HB-467? to filter on collection of composites?

Thank you very much

Andr


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 08, 2004 8:35 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
I don't think
Code:
select maxindex(order.items) from Order order
works.
But you can do a pure SQL query using session.connection()

_________________
Emmanuel


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

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.