• 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

EJB 3.0 JPQL dbt

 
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

When reading ejb-3_0-fr-spec-persistence.pdf i came across this in chapter 4 Query language page 83 section 4.4.2 "Identification variables"

in the query given
SELECT DISTINCT o
FROM Order o JOIN o.lineItems 1 JOIN 1.product p
WHERE p.productTypr = 'office_supplies'

It is mentioned that

1) An identification variable is a valid identifier declared in the FROM clause of query

2) Also in section 4.4.1 spec says that the character sequence must begin with a Java identifier start character

3) again in 4.4.2 -- ... the identification varaible 1 evaluates to any LineItem value ...

the part where i am confused is can "1" be identifier variable?

If not , some one please explain which all are identifier variables in the above query.

Suchitra
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nope 1 cannot be. if you think that the identification variable after lineItem is '1' (one) then to correct you, it is letter l.

a identification variable must start with a letter or _ or $.

hope this helps
 
Bartender
Posts: 3778
40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Vivek S. kumar:


a identification variable must start with a letter or _ or $.



Hi Vivek !

This is not completely accurate:

The character sequence must begin with a Java identifier start character.

An identifier start characters set includes the underscore (_) character and the dollar sign ($) character.

So, to be more accurate we can say:


An identification variable *MAY* start with a letter or _ or $



NOTE, the question mark (?) character MAY NOT be used in identification variables (it's not hard to remember, since Java does not allow it too).

regards,
MZ
reply
    Bookmark Topic Watch Topic
  • New Topic