[Logo]
Forums Register Login
Can I join two tables in a NamedQuery?
Hello,

I have two tables that have one to one relationship and I have created java classes for both of them and annotated with @Entity.
Now for a particular case, I want to join both these tables and fetch the data.
Can tables be joined in @NamedQuery ?
Is yes , could you provide a sample.

If it cannot be done using @namedQuery then is it advisable to use @NamedNativeQuery in this scenario.

Thanks for the help.
You know it is dark times when the trees riot. I think this tiny ad is their leader:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss


Reply locked
This thread has been viewed 734 times.

All times above are in ranch (not your local) time.
The current ranch time is
Jul 23, 2018 09:43:13.