This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Q. EJB-QL SELECT - when to use Object() Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Q. EJB-QL SELECT - when to use Object()" Watch "Q. EJB-QL SELECT - when to use Object()" New topic
Author

Q. EJB-QL SELECT - when to use Object()

Karin Paola Illuminate
Ranch Hand

Joined: Oct 18, 2002
Posts: 109
Who knows the "Sharpen your pencil" answers? I can't find them on the Oreilly web site.

Circle the EJB-QL statement if it has a legal SELECT clause
SELECT OBJECT (m) FROM MovieSchema m
SELECT m.title FROM MovieSchema m
SELECT m from MovieSchema m
SELECT OBJECT (m.title) FROM MovieSchema m


Thanks in advance.


I not only use all the brains that I have, but all that I can borrow. [Laurence J. Peter]
Shiang Wang
Ranch Hand

Joined: Jun 20, 2003
Posts: 96
Circle the EJB-QL statement if it has a legal SELECT clause
SELECT OBJECT (m) FROM MovieSchema m - ok
SELECT m.title FROM MovieSchema m - ok
SELECT m from MovieSchema m - not ok - must use OBJECT(m)
SELECT OBJECT (m.title) FROM MovieSchema m - not ok,
OBJECT can't use cmp or cmr field

Basically if you use Object only when you want the every thing in the abstract schema (instead of field) to return. Note that it is case INsensitve.

Shiang


SCBCD, SCWCD, SCJP
 
 
subject: Q. EJB-QL SELECT - when to use Object()