Reputation: 11
How to write join query using @query in spring data jpa without mapping (@oneToOne or manyToOne) between two entities class?
Upvotes: 1
Views: 3166
Reputation: 2755
Have you tried using @Query(value = "", nativeQuery = true)
?
Upvotes: 0
Reputation:
Unfortunately this is not supported by JPA. Therefore Spring Data JPA can not join unrelated entities.
Hibernate 5.1 introduced explicit joins. You can leverage this feature by adding a custom repository implementation.
Upvotes: 1