Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

native insert query in jpa repository

@Repository
@Transactional
public interface FruitsRepository {
   @Modifying
   @Query(value = "insert into fruits_table (id, name) VALUES (?1, ?2)", nativeQuery = true)
   void insertIntoFruitsTable(long id, String name);
}
 
PREVIOUS NEXT
Tagged: #native #insert #query #jpa #repository
ADD COMMENT
Topic
Name
9+6 =