java - Spring data jpa + joining 2 tables -


i have 2 entity classes product , productaltid no @onetomany mapping defined between them.

i want this

select p productaltid inner join product pai p.id = pai.id 

how can achieve this?

add method productaltid repository (choosing 1 because query returns productaltids):

@query("select pai productaltid pai "  + "where pai.id in (select p.id product p)") list<productaltid> findforallproducts(); 

i switched aliases around, seem backward in example.


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -