简体   繁体   中英

How to use fetch='join' in Hibernate?

I encountered a problem on usering Hibernate. Table A one-to-one Table B and Table A one-to-one Table C.Now I use the method get(A.class, id), but Hibernate generate two sql:the first one a join b, the second is "select c" when use the property c in a, That is fetch="join" is fail in a and c, Who can help me find the reason?

from Cat as cat
inner join cat.mate as mate
left outer join cat.kittens as kitten

More examples here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM