-->
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.  [ 3 posts ] 
Author Message
 Post subject: Can I bind a size=0 List in Expression.in?
PostPosted: Wed Dec 03, 2003 9:51 pm 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
I used Criteria to create query like Criteria crit = session.createCriteria(XXX.class);. I had an in condition like crit.add(Expression.in("XXX", aaaList)); aaaList is a dynamic list and I found it works when aaaList.size > 0. But when aaaList.size = 0 that means I need not query with this condition, it throws Exception:
java.lang.NegativeArraySizeException

at java.lang.StringBuffer.<init>(StringBuffer.java:115)

..................

Do I have any mistake? Need check aaaList.size == 0? by myself before crit.add(Expression.in("XXX", aaaList)); ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 9:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
add a bug report with the full stack trace to JIRA


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2003 10:09 pm 
Regular
Regular

Joined: Wed Dec 03, 2003 9:41 pm
Posts: 87
Are you sure it is a bug?How can I do now?add check aaaList.size()==0 before crit.add(Expression.in("XXX", aaaList)); ?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.