JPA/Hibernate maximum number of joins?

后端 未结 5 1803
面向向阳花
面向向阳花 2021-01-14 15:42

Is there a limit to the number of joins permitted in a JPA/Hibernate query?

Since Hibernate doesn\'t automatically join, I have to explicitly specify the joins in my

5条回答
  •  臣服心动
    2021-01-14 16:08

    Are you aliasing all of your inner joins? And using those aliases? I have seen some really strange behavior with Hibernate when you try and use implicit aliasing in the SELECT clause to do stuff like this (extremely simplified example):

    select p.address.state from person p
    

    But if you explicitly declare all your aliases it works just fine. Like this:

    select s from person p join p.address a join a.state s
    

    ... or even this:

    select s from person p join p.address.state s
    

提交回复
热议问题