• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

[SCBCD 5.0] Simplified (reduced) SELECT clause form

 
Bartender
Posts: 3903
43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's hibernate
 
Mikalai Zaikin
Bartender
Posts: 3903
43
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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...
 
Ranch Hand
Posts: 445
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic