java - How far do entity beans within entity beans go? -
i'm not sure if i'm asking correctly i'll try make clear can. have entity bean has foreign keys other entity beans. 1 of these foreign keys brings set of other entity beans. want entity bean out of each entity bean in set. it's this
bean 1 -> bean 2 -> bean 3
or
bean 1
gets bean 2
gets bean 3
i have hql query bringing collection of bean 1
. know can @ bean 2
bean 1
able @ bean 3
bean 2
running original query? or need run separate hql query @ bean 3
?
yes can bring entire tree in hql if need to. see reference information
a "fetch" join allows associations or collections of values initialized along parent objects using single select. particularly useful in case of collection. overrides outer join , lazy declarations of mapping file associations , collections. see section 19.1, “fetching strategies” more information.
from cat cat inner join fetch cat.mate left join fetch cat.kittens
Comments
Post a Comment