Hi everyone,
I've very new to using Hibernate and have been unable to find any information to help me out with this scenario.
If I have several Objects, something like...
(yes I haven't put the getters/setters in)
Code:
class Parent
{
long aLongId
long anotherLongId
ListImpl getData()
}
class Child
{
String name;
String value;
}
* There is a one to many of between Parents and Children
I've been able to pull in Parent objects fine with all related Child objects using QBE as documented.
The problem I am having is pulling in Child objects where the Parent has say anotherLongId of 1
ie.
Quote:
SELECT "all Children objects" WHERE "the child's parent anotherLongId attribute" = 1 AND "children object's name" = 'aChildname'
In SQL I'd expect something like...
Code:
SELECT c.value
FROM Child c
JOIN Parent p on p.data_id = c.id
WHERE c.name = 'aChildName'
AND p.anotherLongId = 1
Any help would be appreciated. If this is documented somewhere any pointers would be good. I've read all the hibernate.org online doco.