I\'ve got JPA entity class like this:
@Entity
@Table(name = \"person\")
public class Person {
@Id
private Long id;
private String lastName;
private S
You should look into Hibernate Criteria. You can stack restrictions as such:
List cats = sess.createCriteria(Cat.class)
.add( Restrictions.like("name", "Fritz%") )
.add( Restrictions.or(
Restrictions.eq( "age", new Integer(0) ),
Restrictions.isNull("age")
) )
.list();
Restrictions refer to annotated variables in the class. Take a look at the documentation.