Hibernate version:3.1.1
Name and version of the database you are using: Oracle9
I have a class called Person
- a Person who has an Address have no ContactDetails
- a Person who has a ContactDetails (phone, email, etc..) have no Address
I want to fetch the people who have
an
address.city = 'METZ'
OR
a
contactDetails.email like '%hotmail.fr'
(city is a simple property of Address class)
(email is a simple property of ContactDetails class)
I know how to create Aliases for Address and ContactDetails.
As soon as I create an Alias for address I know longer see Person with no Address. As soon as I create an Alias for contactDetails I know longer see Person with no contactDetails.
Since I want both to be in the where clause my result set is always empty.
Heeellllppp :-(
Looks like :
http://opensource.atlassian.com/project ... e/HHH-1137
But I am not sure. If it is, only solution seems to be HQL.
Subsidiary question: How to order my rows of Person by city or by email.
i.e. if there is no Address use order by email, and use order by city if there is no contactDetails:
http://forum.hibernate.org/viewtopic.php?t=964506
Thanks in advance.
edit: I partially solved my problem using
Hibernate 3.1.2 and createAlias with joinType