1

How to write join query using @query in spring data jpa without mapping (@oneToOne or manyToOne) between two entities class?

0

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

Comments

0

Have you tried using @Query(value = "", nativeQuery = true) ?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.