Reputation: 11
I am using dropwizard hibernate and there I am using @NamedQuery()
I didn't find any source to put my data into my database
Upvotes: 0
Views: 3006
Reputation: 1293
You can do INSERT with HQL (Hibernate Query Language):
Statement types
Both HQL and JPQL allow
SELECT
,UPDATE
andDELETE
statements to be performed. HQL additionally allowsINSERT
statements, in a form similar to a SQLINSERT FROM SELECT
.
See: HQL and JPQL
Upvotes: 0
Reputation: 16141
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)
Upvotes: 0