Hibernate DefaultEntityAliases raises NullPointerException

后端 未结 2 1809
眼角桃花
眼角桃花 2021-01-07 23:20

I\'m using Spring Boot, Spring Data REST, Hibernate (5.2.12.Final) and I\'m exposing my repositories as REST services.

I\'ve a problem with a query that raises a Nul

相关标签:
2条回答
  • 2021-01-07 23:33

    Yes there's a bug report for this exact situation with @Formula annotation and nativeQuery... you can add 5.2 as an affected version since it's reported only to 5.1

    https://hibernate.atlassian.net/browse/HHH-7525

    0 讨论(0)
  • 2021-01-07 23:46

    A simple workaround I used (since the one in the issue doesn't work anymore), is use a native query to just retrieve the id, then a normal repository.findOne(id) to fetch the entity with the formula, double queries, but hey, it works

    0 讨论(0)
提交回复
热议问题