• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Doubt in Enthuware question

 
Omar Al Kababji
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, in the following question:

Identify FALSE (i.e. INCORRECT) statements about JPQL.
A) It can be used to select values only from tables that have been mapped to the abstract persistent schema.
B) Insert statements are not supported by JPQL. New rows can be created in the database using em.persist() operation.
C) It can be used to insert new rows into the database.
D) It can be used to update EJB 3.0 Entities.
E) It can accomodate complex joins involving multiple tables.
F) JPQL queries are compiled into the database specific SQL queries by the container.
G) All containers must support JPQL as specified in the EJB Specification so it is vendor independent.
H) It is vendor independent.


according to the simulator the correct answer is (B) and yes I agree with that, however can't I consider also the answer (A) ?? for example can't I access tables that are not mapped to the abstract persistent schema using native SQL language ?? using EM.createNativeQuery ??

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using a native query is not like using JPQL. These are two differents beasts. The question is about JPQL only, not native queries. So I think that A is true. With JPQL, you can only access tables that have been mapped to the abstract persistent schema.
 
Omar Al Kababji
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you, so native SQL queries created by the entity manager are not considered as part of the JPQL
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic