Skip to content
Advertisement

native query join in spring data

I have the class:

JavaScript

I want to know if it’s possible to use a native query join in spring data JPA and if the result of query was correctly mapped into entities like the above example.

Can someone show me a complete example to user this. I must to use a native query in my case and I am not sure that work.

Advertisement

Answer

you can do that by using named native query and result set mapping and here is a complete exmaple

Mission Entity

JavaScript

User Entity

JavaScript

Repository Function

JavaScript

Controller Function

JavaScript

and this is The Result

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement