Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.2 final
Mapping documents:
N/A
Code between sessionFactory.openSession() and session.close():
N/A
Full stack trace of any exception that occurs:
N/A
Name and version of the database you are using:
MySQL 5.0.20
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html
Hi All,
I have read all the docs and HQL examples, but can't find any that offer a solution to my problem.
I'm using HQL, and I want to do multiple inner joins on the same object, but I want the result to be an or condition. For example, in regular SQL the equivalent of:
select distinct m.* from
message m
inner join ( message_addressing_brand mab, message_addressing_location mal, message_addressing_role mar, message_addressing_user mau )
on ( m.id=mab.message_id or m.id=mal.message_id or m.id=mar.message_id or m.id=mau.message_id)
If I try the following in HQL:
select distinct m from message m inner join m.brands inner join m.users inner join m.roles inner join m.locations it returns 0 rows because it is effectively 'anding' the conditions.
Thanks in advance,
Ian