A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
this week in the
Other Open Source APIs
join Hibernate query problem (Small problem)
Michael van Adrichem
Joined: May 20, 2011
May 26, 2011 02:42:09
I have a small problem.
I have two tables. The table Personeel and the table succes.
What i wanna do is get the data from both personeel and succes, but i dont want duplicates.
So the query i use is:
from Personeel p join fetch p.succeses as s
It now nicely displays only the personeels records that are linked to the table succes.
However, it is not showing the data from the table succes, only from the personeel table.
What am i missing in my query that it also shows the data from the succes table?
Joined: Feb 13, 2009
May 27, 2011 14:19:24
What do you mean with "However, it is not showing the data from the table succes, only from the personeel table."
The succeses atribute must came loaded in the Personeel objects, not in an array if it's what you hoping for...
You can try 'from Personeel p, s join fetch p.succeses as s' but the first way is better.
I agree. Here's the link:
subject: join Hibernate query problem (Small problem)
java.lang.NumberFormatException: For input string: ""
Some question about Java Progarmming
Java Progarmming about Database
simple inner join question
Hibernate: query returning data from multiple tables
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2015