Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

EJB 3.0 JPQL dbt

 
Suchitra Bhat
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • 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
 
Vivek S. kumar
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • 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
 
Mikalai Zaikin
Ranch Hand
Posts: 3381
12
  • Mark post as helpful
  • send pies
  • 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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!