• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

spec 11.2.7.11 EJB-QL

 
Dan T
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont understand what spec is talking about here.

it says (have to type it out, dont know how to copy+paste for pdf)

"The collection designated by the collection-valued path expression used in an empty collection comparison expression must not be used in the FROM clause for the declaration of an identification variable. An identificaition variable declared as a memeber of a collection implicitly designates the existence of a non-empty relationship; testing whether the same collection is empty is contradictory. "

And why is the example given is invalid?

SELECT OBJECT (o)
FROM Order o, IN(o.lineItems) l, WHERE o.lineItems IS EMPTY

hmm.. l isnt used..


Thanks.
[ August 08, 2004: Message edited by: Ryan Wong ]
 
alzamabar
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ryan Wong:
I dont understand what spec is talking about here.

it says (have to type it out, dont know how to copy+paste for pdf)

"The collection designated by the collection-valued path expression used in an empty collection comparison expression must not be used in the FROM clause for the declaration of an identification variable.


This means that if you declare an identification variable from a collection valued path expression (like in the IN(o.lineitems)l - part of the FROM part of your EJB-QL) the collection must NOT be empty for the query to be legal, therefore using: WHERE o.lineItems IS EMPTY is not legal because o.lineItems must not be empty.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic