0

I am using dropwizard hibernate and there I am using @NamedQuery() I didn't find any source to put my data into my database

Roshana Pitigala
  • 8,437
  • 8
  • 49
  • 80
Mukul
  • 11
  • 3

2 Answers2

0

You can do INSERT with HQL (Hibernate Query Language):

Statement types

Both HQL and JPQL allow SELECT, UPDATE and DELETE statements to be performed. HQL additionally allows INSERT statements, in a form similar to a SQL INSERT FROM SELECT.

See: HQL and JPQL

Eric Green
  • 1,151
  • 9
  • 17
0

To put data into the database the Hibernate way use the EntityManager interface. It has two methods to put data into the database:

<T> T merge(T entity)

void persist(Object entity)
Robert Niestroj
  • 15,299
  • 14
  • 76
  • 119