Hi ramnath,
thanks for your reply.
The problem is not that the java property is null (it's not), but that DB content is null.
I hope you know what I'm talking about.
Thanks for your help
ramnath wrote:
Hi,
Hibernate wants you to check the null values. If the values are null then don't add it to the criteria.
i.e)
Criteria criteria = session.createCriteria(Employee.class)
if(<name.property> !=null)
criteria.add( Restrictions.eq("name",<name.property>) )
if(<salary.property> !=null)
criteria.add( Restrictions.eq( "salary", <salary.property> ) )
List emps = criteria.list();