• Post Reply Bookmark Topic Watch Topic
  • New Topic

Is this a valid query ?  RSS feed

 
Sankar Subbiramaniam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is the following query valid ? (The Object clause is missing)
SELECT t
FROM Player p, IN (p.teams) AS t
 
Sankar Subbiramaniam
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, i could finally verify this query in RI.

Answer: The query is wrong. It should be defined as below:
SELECT object(t)
FROM Player p, IN (p.teams) AS t

This confirms to the spec statement (page 232, 11.2.8):
All standalone identification variables in the SELECT clause must be qualified by the OBJECT operator.

I found the erroneous query in J2EE1.3 tutorial from SUN (go to the bottom of the following link to find the query):
erroneous query in J2EE1.3 tutorial
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!