0

How can I select some records from two defferent tables and insert the selected records in a third table in spring boot application without having any association between the entities.

Insert into lager_product(ean,articleNumber,productText,productMaterial)
select lot_lager.EAN, lot_lager.ART_NR, product.p_text, product.p_comp_material_

from lot_lager join product on lot_lager.EAN = product.a_ean

akas25n
  • 1
  • 1

1 Answers1

0

If there is not relationship between entities in database, thus spring JPA cannot do it by usual repository methods. BUT Springboot does provide interface to execute native queries for similar or more complex scenarios. Try using custom method to do it example How to add custom method to Spring Data JPA

Defaulter
  • 358
  • 1
  • 4
  • 17