This week's book giveaway is in the Web Services forum.
We're giving away four copies of Microservices in Action and have Morgan Bruce & Paulo A. Pereira on-line!
See this thread for details.
Win a copy of Microservices in Action this week in the Web Services forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Doubt in Enthuware question  RSS feed

 
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 ??

 
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
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!