Hi, I have a class Person with these attributes: firstname:
String, lastname:String and birthday:Date.
I'm trying to use the Hibernate Criteria API by creating a new Person and setting some of the attributes with values that I want to query the database against.
Person person = new Person();
person.setFirstname("Paul");
I then create a new Example thus:
Example example = Example.create(person);
example.enableLike();
example.excludeZeroes();
...after which I create the Criteria:
...createCriteria(Person.class).add(example).list();
The problem is that this doesn't return any result (empty list) even though I know for certain that there is row where the firstname-column contains 'Paul'. What am I doing wrong here? Have I completely misunderstood the usage of Example together with Criteria?