Only to confirm, "INSERT INTO table VALUES(:parameter)" not is specified in JPQL like exists in HQL right?
Exists any method to not use native query to get anything like?:
INSERT INTO table1
SELECT * FROM table2;
Or "INSERT FIRST"/"INSERT ALL"?
About Question enthuware.oce-jpad.v6.2.566 :
Moderator: admin
-
- Posts: 21
- Joined: Fri Apr 11, 2014 8:57 pm
- Contact:
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.566 :
No, "Insert into table" does not exist in JPQL because ideally you should be creating entities using the new keyword and then persisting them using the entity manager. For example: Student s = new Student(); entityManager.persist(s);
You have to use native query to do "insert into...".
I am not aware of HQL.
HTH,
Paul.
You have to use native query to do "insert into...".
I am not aware of HQL.
HTH,
Paul.
If you like our products and services, please help us by posting your review here.
-
- Posts: 39
- Joined: Thu Jan 29, 2015 4:49 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.566 :
Option 4 is correct.
JPQL can NOT be used to update JPA 2.0 Entities. To update database, but not entities.
JPQL can NOT be used to update JPA 2.0 Entities. To update database, but not entities.
-
- Site Admin
- Posts: 10036
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.oce-jpad.v6.2.566 :
It is actually used in the same sense as the one mentioned by the specification section 4.2 (Page 133) :
Also, you cannot update just about any database table using JPQL because it works on "entities" defined in your abstract schema.The update and delete clauses determine the type of the entities to be updated or deleted.
If you like our products and services, please help us by posting your review here.
Who is online
Users browsing this forum: No registered users and 32 guests