I want to write a union like
Select a.id,a.desc,b.desc from A a left join B b on a.MEDIA_ID = b.ID
I created two objects A and B and created CrudRepository<A,Long> .
Now in crudRepository you need to write a method that can receive data using the union above.
In addition, I created a transition variable in entity A (referred to as "bDescription") how to do this in Spring JPA data.
Note. I need to join to find out the "description" (column in B) for a specific identifier (primary key in B and displayed as "MEDIA_ID" in A) of object B ..
Thanks at Advance
source share