Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] criteriaquery : fetch not working

 Le 4/08/2011 17:11, Tom Ware a écrit :
Hi Yannick,

When you run a query, EclipseLink will get not only the object you are looking for and the items that are fetch joined, but also any EAGERly fetched relationships from any of the entities that are retrieved. That is likely the reason you are seeing additional queries.

  You should take a look at our attribute group feature.  It may help:

http://wiki.eclipse.org/EclipseLink/Examples/JPA/AttributeGroup

Hi Tom,

Thanks for your answer, very quick ;-)

I understand that, but I think there are some issues. I double-checked, we don't have any relation defined as EAGER, and I understand the default is LAZY.

Also, I don't see any effect from the last fetch:

root.join(EtdOffEtd_.epcOffre).fetch(EpcOffre_.epcOffreEleCollection, JoinType.LEFT);

... although I can see the effect of the other fetch calls, and I can see the very first sql query changing if I remove them.

I'd expect EpcOffreEle's to be fetched, which isn't the case.

I tried to get more debugging, but didn't succeed in finding out *why* each sql query is triggered.

Regards,

Yannick


Back to the top