i wonder how this could be done with the criteria-api:
Code:
"select p.firstname, geo.zip_code from Person p
join Address_Data geo on p.id = geo.person
join Phone ph on p.id = ph.person"
Its a unidirectional association from Address_Data to Person:
example scennario:
Code:
class Person{String attrib;}
class AddressData{String attrib; Person person;}
class Phone{String attrib; Person person}
in plain SQL it doesnt matter which entity holds the foreign-key - the query remains the same, but using Criteria-API with unidirectional associations its a bit difficult i think..
i really would like to avoid bidirectional assoc.
dont get me wrong: i know how to set up a bidir. assoc. but i really just would like to avoid them in some cases;)