0

I am using JPA @Query annotation . Want to insert into two table using simple oracle query in JPA. How can I achieve this .

Don't want to use begin clause . Want single query to insert into two table.

Don't want to used one to many or any relationship due to some restriction.

Ganesh Java
  • 37
  • 2
  • 9

2 Answers2

0

It depends: if you want to have two Entity classes or one mapped from two tables. In the second case you can do it by @SecondaryTable annotation, more about it you can find on baeldung

paulonio
  • 311
  • 1
  • 5
  • No paulonio , I want to achieve this using @Query annotation with normal sql due to some restriction in project. – Ganesh Java Sep 24 '21 at 13:11
0

I handle this using join and one to many relationship . Thanks all for your support.

Ganesh Java
  • 37
  • 2
  • 9