| Author |
[SCBCD 5.0] Simplified (reduced) SELECT clause form
|
Mikalai Zaikin
Ranch Hand
Joined: Jun 04, 2002
Posts: 3099
|
|
Howdy ! I've seen in some places the reduced form of SELECT clause, like : while the "full" form defined by spec is as follows: So, the question is: where this "simplified" form of SELECT came from ? Is id defined in EJB 3.0 spec, maybe I overlooked it ? Thanks, MZ
|
Free SCDJWS 5.0 Study Guide - SCDJWS 5.0 Quiz (How to get SCDJWS 5.0 Quiz)
Java Platform, Enterprise Edition 6 Web Services Developer Certified Expert Exam Study Guide and Quiz
|
 |
Edvins Reisons
Ranch Hand
Joined: Dec 11, 2006
Posts: 364
|
|
Hello Mikalai, don't know about the source of this strange abbreviation of queries, but the persistence specification is 100% precise (see 4.14, Query Language BNF): which means that the SELECT clause is NOT optional, and anybody who writes and implements a query without SELECT (JBoss server and tutorials come to mind ), is deviating from the spec.
|
 |
Yevgen Bushuyev
Greenhorn
Joined: Dec 10, 2002
Posts: 9
|
|
|
That's hibernate
|
 |
Mikalai Zaikin
Ranch Hand
Joined: Jun 04, 2002
Posts: 3099
|
|
Originally posted by Yevgen Bushuyev: That's hibernate
Yevgen, thanks a lot ! AFAIK, JBoss uses Hibernate as JPA provider, so simplified SELECT queries are Ok for JBoss, but not Ok for other servers...
|
 |
Rizwan Mohammad
Ranch Hand
Joined: Sep 02, 2005
Posts: 445
|
|
I have used this form of queries(i.e without select) while working with hibernate. In those cases it returns all entities mentioned in FROM clause. According to ejb3.0 spec both select and from clauses are mandatory. May be JBoss server support this form of queries as extra benefits. But such queries definitely will not be portable across application servers.
|
Rizwan
SCJA, SCJP, SCWCD, SCBCD, SCDJWS.
|
 |
 |
|
|
subject: [SCBCD 5.0] Simplified (reduced) SELECT clause form
|
|
|