Say, I have a parent-child type of table relationship, say, Cat and Kitten.
How will I define the XML mapping or the class definition in such a way
that when I load the Cat info from the database, it will load only Kittens with, like, red noses?
Like this,
Code:
Cat c = (Cat)query.createNamedQuery( "from Cat where name = 'lovella'" );
List kittens = c.getKittens();
Cat, "lovella", might have twenty kittens... I am only interested to get kittens with red noses... something like that.
The usual, parent-child relationship will surely load all the kittens belonged to a certain cat right?.
how will i change my xml definition to meet my needs?
(i want to get rid of other kittens that's why im planning to permanently get red-nosed kittens only).
cheers.