Beginner |
|
Joined: Sat Aug 30, 2003 1:36 am Posts: 47 Location: Calgary, AB
|
Cat cat = new Cat();
cat.setSex('F');
cat.setColor(Color.BLACK);
List results = session.createCriteria(Cat.class)
.add( Example.create(cat) )
.list();
If cat.myCollection had some values in it, would those be used in the query? Or do you have to add an association criteria like so:
Cat cat = new Cat();
cat.setSex('F');
cat.setColor(Color.BLACK);
List results = session.createCriteria(Cat.class)
.add( Example.create(cat) )
.createCriteria("kittens")
.add( Expression.like("name", "F%")
.list();
?
|
|