How to construct an insert query in JPA

后端 未结 3 1961
庸人自扰
庸人自扰 2021-01-04 23:33

I am trying to insert data into a table having columns (NAME, VALUE) with

Query query = em.createQuery(\"INSERT INTO TestDataEntity (NAME,          


        
3条回答
  •  星月不相逢
    2021-01-05 00:35

    I solved the issue.

    According to this,

    There is no INSERT statement in JPA.

    But I could solve the issue with native query: I have mistakenly put a redundant ; at the end of the query, so the issue solved by removing it.

提交回复
热议问题