This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Misunderstood Enthuware Questions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Misunderstood Enthuware Questions" Watch "Misunderstood Enthuware Questions" New topic
Author

Misunderstood Enthuware Questions

Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
Which of the following statements are correct regarding Java Persistence Query Language (JPQL)?

1) A JPQL Query must contain a 'select' and a 'where' clause.

2) A JPQL query must contain a 'select', a 'where', and a 'from' clause.

3) A JPQL query must contain a 'select', and a 'from' clause.

4) JQPL queries are based on the database schema.

5) None of these.

the correct answer given is 5. Just for your information, in the previous version (EJB 2.0), the query language was called EJBQL and it only supported select queries. Now, in EJB 3.0, it is called JPQL and it supports all types of queries. The syntax of both is quite similar with minor differences. Some new built in functions have also been added. For the purpose of the exam, you don't have to worry about EJBQL. Just go through chapter 4 of EJB 3.0 Persistence specification. It is quite easy to understand.

According to me the correct answer is 3.


SCJP 1.4, SCWCD 5, SCBCD 5, OCPJWSD 5,SCEA-1, Started Assignment Part 2
My blog- http://rkydesigns.blogspot.com
Imran Arif
Greenhorn

Joined: Nov 16, 2008
Posts: 2
A JPQL query may be contain 'update' or 'delete' clause.


SCJP (91%), SCWCD (85%), Target SCBCD
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3199
    
    2
Amandeep, There is an explanation for every option in this question( Qid: com.enthuware.ets.scbcd.v5.2.177 ) . Did you read that?


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
Bod Toki
Ranch Hand

Joined: Sep 01, 2006
Posts: 95
Query query = em.createQuery("UPDATE Post p SET p.body = 'this reply' WHERE p.user like '%Bod Toki%'");
int results = query.executeUpdate();

Query query = em.createQuery("DELETE Post p WHERE p.body = 'this reply''");
int results = query.executeUpdate();

These are valid JPQL queries and I do not see a 'SELECT' statement or 'FROM' clause...
When EJB3.0 talks about queries it means selects, updates, deletes.... not just selects.
Amandeep Singh
Ranch Hand

Joined: Jul 17, 2008
Posts: 844
ok ok i got it. I was wrong here.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Misunderstood Enthuware Questions
 
Similar Threads
SCBCD 5 - Exam Objectives
Question on JPQL...
Doubt in Enthuware question
Join Fetch using EclipseLink
EJB 3: JPA versus Beginning EJB 3 App Dev