Hi! Thanks for your reply.
Regarding versions, I currently use 4.2.0.Final, but also switched back trying to (3.5.6?), with no effect.
Quote:
How you querying the child object? Which hibernate version are you using?
I do exactly what you wrote:
Code:
Query q = entitymanager.createQuery("SELECT c FROM ChildObject c ")...
but as well read it in a reference from other entity (e.g. a):
Code:
a.getChildObject()
but I always get the select statements.
Quote:
In general, if you defining "JOIN FETCH" explicitly in select statement it would querying the associated objects
Yes, of course I use the fetch as I want to get the objects, I am just suprised that i get these select statemnents instead of a join (as I use a join)
I even tried an additional annotation to influence the fetching:
Code:
@Fetch(FetchMode.JOIN)
but with no effect, I get those additional select statements for both cases.
I found another topic descibing the same problem, whereas the poster points out that it might be related to using a referencedColumnName, and the column is not the primary key of the entity.
@ManyToOne + lazy + referencedColumnName doesn't lazyDaniel