开发者

Change from "Session" to "StatelessSession" and I can fetch my Class complete

开发者 https://www.devze.com 2022-12-30 19:15 出处:网络
I use a stateless session and the follow HQL. CreateQuery(\"select a from Address a\") My Address Class has many B开发者_StackOverflow社区ankDetails but i can\'t access. If i use a normal session i

I use a stateless session and the follow HQL.

CreateQuery("select a from Address a")

My Address Class has many B开发者_StackOverflow社区ankDetails but i can't access. If i use a normal session it works. What can I do?


Use a fetch join to pull in the bank details explicitly rather than relying on an implicit load when you first access the BankDetails property:

CreateQuery("select a from Address a inner join fetch a.BankDetails")
0

精彩评论

暂无评论...
验证码 换一张
取 消