Sorry nordborg I've a mistake in my query.
My previous query was:
Code:
select p.personId, p.name, c.model, c.colour
from Person p
left join p.car.owner
but I can not use the field p.car beacuse from person table there is no way to reach car table.
The unique way to get this information is to start my query from car table but I've to use a right join beacuse I want keep
all people's info even if they have no car. I tried to execute this query
Code:
select p.personIs, p.name, c.model, c.colour
from Car c
right join c.owner p
but the obtained results are not exact because I can not see the information about people that have no cars.
Finally the questions are:
1) Can you use the right join starting from car table, and what is the correct manner to do this?
2) Can I start my query from table person? (Hibernate have created an HashSet of car)
Thank you very much!