Created
December 8, 2012 10:53
-
-
Save rvazquezglez/4239784 to your computer and use it in GitHub Desktop.
Ejemplo de uso de criteria de hibernate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List cats = sess.createCriteria(Cat.class) | |
.add( Restrictions.in( "name", new String[] { "Fritz", "Izi", "Pk" } ) ) | |
.add( Restrictions.disjunction() | |
.add( Restrictions.isNull("age") ) | |
.add( Restrictions.eq("age", new Integer(0) ) ) | |
.add( Restrictions.eq("age", new Integer(1) ) ) | |
.add( Restrictions.eq("age", new Integer(2) ) ) | |
) ) | |
.list(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment