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