How can I insert data with JPQL containing values:
@Query("insert into user values()")
User insertUser();
Data: username emailUser
How can I insert data with JPQL containing values:
@Query("insert into user values()")
User insertUser();
Data: username emailUser
In this way:
String query = "insert into User values(?,?)";
EntityManager em = emf.createEntityManager();
em.createNativeQuery(query)
.setParameter(1, "maria")
.setParameter(2, "123456")
.executeUpdate();