well i use this:
example = Example.create(entity).ignoreCase().enableLike(MatchMode.ANYWHERE);
Criteria crit = session.createCriteria(entity.getClass());
crit.add(example);
lista=crit.list();
like here:
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/querycriteria.html -> 15.6. Example queries
Cat cat = new Cat();
cat.setSex('F');
cat.setColor(Color.BLACK);
List results = session.createCriteria(Cat.class)
.add( Example.create(cat) )
.list();
is the same but i am using generics, if i don't use example, cirt.list() returns all from database table, but if i use example don't returns anything even if matches with some register from database.
i dont know what to do i am using jpa spring and zk