I think hibernate session will return the same object to Cat2 reference if you do have this persistent row in your database.that's to say, only one select statement will be executed in this case.if you do not have this persistent row in database, then an error will be throwed.
so, if you do not want to get this kind of error, just use get() instead of load()
so, if you do not want to get this kind of error, just use get() instead of load()
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货