-->
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.  [ 2 posts ] 
Author Message
 Post subject: what rasons
PostPosted: Thu Jan 08, 2004 11:59 pm 
Regular
Regular

Joined: Thu Dec 25, 2003 12:33 am
Posts: 58
Location: Campina Grande, Brasil
What could be the possible reasons for such an exception:
Code:
java.util.NoSuchElementException
   at java.util.AbstractList$Itr.next(AbstractList.java:426)
   at net.sf.hibernate.util.StringHelper.join(StringHelper.java:30)
   at net.sf.hibernate.expression.Junction.toString(Junction.java:69)
   at java.lang.String.valueOf(String.java:2131)
   at java.util.AbstractCollection.toString(AbstractCollection.java:455)
   at net.sf.hibernate.impl.CriteriaImpl.toString(CriteriaImpl.java:81)
   at java.lang.String.valueOf(String.java:2131)
   at java.lang.StringBuffer.append(StringBuffer.java:370)
   at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:3145)
   at net.sf.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:65)

?
I have a java code like this:
Code:
List ret;
      Criteria crit = session.createCriteria(Proprietario.class);
      crit = crit.add(Expression.disjunction());
      if (!(paf.getBusca().trim().equals(""))){
         crit = crit.add(Expression.like("nome", "%"+paf.getBusca()+"%"));
               }
                if (!(paf.getCpf().trim().equals(""))){
         crit = crit.add(Expression.like("cpf", "%"+paf.getCpf()+"%"));
                }
ret = crit.list();


Thanks in advance

_________________
Ot


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 09, 2004 11:17 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Just a minor problem with the toString() method of Disjunction. Disable logging and it will go away.

Why do you add an *empty* disjunction to your Criteria?


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