You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Erik Bengtson <er...@jpox.org> on 2007/08/17 12:04:55 UTC

jdo 2.1 - 18.14 property

Hi,

§18.14
"When contained in a class element:
- The field-name attribute is required; it associates a persistent field with
the named property."

AFAIR field-name attribute is used for generated classes. It should be optional
when contained in class or interface elements.

e.g.

//user given interface
interface Animal
{
@Persistent(fieldname="kind2")
int getKind();
}

//jdo implementation generated class
class GeneratedAnimal
{
     int kind2;
     int getKind()
     {
        return kind2;
     }
}

or
---

//user given abstract class
abstract Jedi
{
int jedilevel;
@Persistent(fieldname="jedilevel")
int getLevel();
}

//jdo implementation generated class
class GeneratedJedi
{
     int jedilevel;
     int getLevel()
     {
        return jedilevel;
     }
}


The new wording could be:
"When contained in a class or interface element:
- The field-name attribute is optional; it associates a persistent property with
a named field."


Re: jdo 2.1 - 18.14 property

Posted by Craig L Russell <Cr...@Sun.COM>.
Hi Erik,

The 18.14 section is incomplete; it doesn't address the several use  
cases that we discussed a couple of months ago. I'm going to update  
the section as soon as I review the discussion.

Thanks,

Craig

On Aug 17, 2007, at 3:04 AM, Erik Bengtson wrote:

> Hi,
>
> §18.14
> "When contained in a class element:
> - The field-name attribute is required; it associates a persistent  
> field with
> the named property."
>
> AFAIR field-name attribute is used for generated classes. It should  
> be optional
> when contained in class or interface elements.
>
> e.g.
>
> //user given interface
> interface Animal
> {
> @Persistent(fieldname="kind2")
> int getKind();
> }
>
> //jdo implementation generated class
> class GeneratedAnimal
> {
>      int kind2;
>      int getKind()
>      {
>         return kind2;
>      }
> }
>
> or
> ---
>
> //user given abstract class
> abstract Jedi
> {
> int jedilevel;
> @Persistent(fieldname="jedilevel")
> int getLevel();
> }
>
> //jdo implementation generated class
> class GeneratedJedi
> {
>      int jedilevel;
>      int getLevel()
>      {
>         return jedilevel;
>      }
> }
>
>
> The new wording could be:
> "When contained in a class or interface element:
> - The field-name attribute is optional; it associates a persistent  
> property with
> a named field."
>

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!