db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Issue 153: JDOQL super keyword
Date Sun, 08 Jan 2006 21:59:10 GMT
Javadogs,

I've recorded this as Issue 153. I propose to defer this to a future  
release.

Currently super is not a JDOQL keyword, so there is no way to exactly  
duplicate the semantics of Java super. In Java, super is used to  
access a field (or method, but methods are not relevant for JDOQL)  
that is hidden by a subclass field of the same name.

The main use of this in JDOQL would be to access a hidden field where  
the declaring class is not known. If the declaring class is known,  
then the field can be accessed by casting “this” to the declaring  
class in a field navigation expression, e.g. ((MySuperclass) 
this).hiddenField

Craig

On Jan 8, 2006, at 1:15 PM, Michael Bouschen wrote:

> Hi Erik,
>
> do you think we need to support super in JDOQL? You only need it if  
> the cancdidate class hides a supeclass field and if S is the  
> superclass you can write 'super.field' as '((S)this).field'.
>
> Regards Michael
>
>> Craig,
>>
>> In JDOQL BNF, it's not a valid field accessor. The same for  
>> ClassName.super
>>
>> Current
>> -------
>> FieldAccess:
>> FieldName
>> Primary . FieldName
>>
>> Regards,
>>
>> Erik Bengtson
>>
>> Quoting Craig L Russell <Craig.Russell@Sun.COM>:
>>
>>
>>> Hi Erik,
>>>
>>> It is not in the spec because it's already a Java keyword. Please  
>>> see
>>> 14.4:
>>>
>>> Keywords
>>> Keywords must not be used as package names, class names, parameter
>>> names, or variable names in queries. Keywords are permitted as field
>>> names only if they are on the right side of the “.” in field access
>>> expressions as defined in the Java Language Specification second
>>> edition, section 15.11. Keywords include the Java language keywords
>>> and the JDOQL keywords. Java keywords are as defined in the Java
>>> language specification section 3.9, plus the boolean literals true
>>> and false, and the null literal. JDOQL keywords maybe written in all
>>> lower case or all upper case.
>>>
>>> What specifically are you interested in knowing?
>>>
>>> Regards,
>>>
>>> Craig
>>>
>>> On Jan 7, 2006, at 3:57 PM, erik@jpox.org wrote:
>>>
>>>
>>>> Hi,
>>>>
>>>> Is it intentionally not in the spec?
>>>>
>>>> Regards,
>>>>
>>>> Erik Bengtson
>>>>
>>> Craig Russell
>>> Architect, Sun Java Enterprise System http://java.sun.com/ 
>>> products/jdo
>>> 408 276-5638 mailto:Craig.Russell@sun.com
>>> P.S. A good JDO? O, Gasp!
>>>
>>>
>>>
>>
>>
>>
>
>
> -- 
> Michael Bouschen		Tech@Spree Engineering GmbH
> mailto:mbo.tech@spree.de	http://www.tech.spree.de/
> Tel.:++49/30/235 520-33		Buelowstr. 66			
> Fax.:++49/30/2175 2012		D-10783 Berlin			
>

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message