Oh man! haha, that is similar to a question I've been asking around for a while now. But I will answer your question with a question and try to answer your particular situation, hopefully others will join in and have some better answers.
I am assuming that the children.
id is the primary key of children. So why are you trying to retrieve a Person whose child is a unique child. In that case shouldn't you try to retrieve a child? and that child's parent will just be present within the Child bean?
Are you look more for getting a Person whose children have blue eyes or something like that? If that is the case I have used some things called filters. Filters have seem to have some restrictions when it comes to ordering and really puts a huge limitation, never really found a good way. I think hql would be ideal for you in this case. Maybe you can try something like this...
Code:
session.createSql("Select p, c from Person p join p.children pc where pc.eyeColor = 'blue'")
I am assuming something like that, I can test it out and let you know of you can test it out. I currently do not have access to the environment needed to test this. I am not too sure about the join syntax though. Check here for many types of joins... There is this with clause that you can use...
http://docs.jboss.org/hibernate/core/3. ... ryhql.htmlTry this too...
Code:
session.createSql("Select p, c from Person p join p.children pc with pc.eyeColor = 'blue'")
Hope this is somewhat relevant to what you needed.
SB