I\'ve got JPA entity class like this:
@Entity
@Table(name = \"person\")
public class Person {
@Id
private Long id;
private String lastName;
private S
So you're looking for a prototype? Hibernate has a handy Example
criteria just for this, so if you don't mind tying yourself to the Hibernate API, try this example from the docs:
Cat cat = new Cat();
cat.setSex('F');
cat.setColor(Color.BLACK);
List results = session.createCriteria(Cat.class)
.add( Example.create(cat) )
.list();
It specifically says:
Version properties, identifiers and associations are ignored. By default, null valued properties are excluded.
Which is just what you appear to want.