persistence@glassfish.java.net

RE: Question about constructor expression in the Java Persistent query language

From: Mike Keith <michael.keith_at_oracle.com>
Date: Thu, 2 Nov 2006 17:25:08 -0500

Hi Michael,

I actually thought we had made it a state field path expression,
not a single valued path expression, but since we do allow entities
to be passed into the constructor it was clearly just an oversight.
Since you can do:

   SELECT NEW test.BobDisplay(a.bob) FROM Ann a

it would only make sense that you should also be able to do:

   SELECT NEW test.BobDisplay(b) FROM Bob b

I would go ahead and implement it and we can fix the spec grammar in a
maintenance release.

-Mike

> -----Original Message-----
> From: Michael.Bouschen_at_Sun.COM [mailto:Michael.Bouschen_at_Sun.COM]On
> Behalf Of Michael Bouschen
> Sent: Thursday, November 02, 2006 4:48 PM
> To: Linda G. DeMichiel; Mike Keith
> Cc: persistence_at_glassfish.dev.java.net
> Subject: Question about constructor expression in the Java Persistent
> query language
>
>
> Hi Linda, hi Mike,
>
> there is a forum post about a constructor expression in a Java
> Persistence query:
> http://forums.java.net/jive/thread.jspa?threadID=19642&tstart=0
> The user tries to pass an identification variable as argument of a
> constructor expression:
> SELECT NEW test.BobDisplay(b) FROM Bob b
> The query BNF defines a constructor item as a single valued path
> expression or an aggregate. Both does not allow an identification
> variable. Is there any particular reason for excluding an
> identification
> variable from a constructor argument?
>
> Thanks!
>
> Regards Michael
>