DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Marcos has posted 4 posts at DZone. View Full User Profile

Hibernate Query By Example

  • submit to reddit
        // shows how to use hibernate query by example (QBE)

public List<Person> find(Person person) {

	Session session = getSession();

	Example example = Example.create(person)

	List<Person> result = session.createCriteria(Person.class)
	return result;