I am trying to insert data into a table having columns (NAME, VALUE) with
Query query = em.createQuery(\"INSERT INTO TestDataEntity (NAME,
I was able to do this using the below - I just had a Table name Bike with 2 fields id and name . I used the below to insert that into the database.
Query query = em.createNativeQuery("INSERT INTO Bike (id, name) VALUES (:id , :name);");
em.getTransaction().begin();
query.setParameter("id", "5");
query.setParameter("name", "Harley");
query.executeUpdate();
em.getTransaction().commit();