I am having some trouble mixing and matching fetches and selects using hibernate. Basically, I am listing a bunch of users in a user table which also contains a "createdBy" column which references the user table by id Ex:
id | name | foo | createdBy
----------------------------
1 abc zzz 2
2 def zzz 2
因此, 在上述例子中,我要举一个例子,说明为“abc”制造的“def”用户将被退回。 页: 1
因此,如果没有创建的By,我就认为:
from User u inner join fetch e.foo as foo inner join fetch foo.bar as bar
我如何插入
"select User u2 from User where u2.id=u.createdBy"
进入先前的询问?