Hibernate version: 2.1.7
Hi,
Is it possible to write a query in hibernate like,
"from Parent parent where parent.child.age=3"
and even
"from Parent parent where parent.children.age=3"
where I assume that parent entity has a composite-element list of child, children.
or we need to explicitly write the join.
"from Parent p join p.Child child where child.age =3"
if JOIN is necessary, I have not understood the need for the JOIN in those kind of queries. What can go wrong if we write queries like the first 2-joinless ones?
I guess it can be possible for the hibernate core to parse query, match mappings and then construct the SQL query with necessary JOINs.
Thanks in advance.
|