db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andy Jefferson <a...@jpox.org>
Subject Re: DISCUSS remove @Field and @Property; add @Persistent
Date Thu, 19 Jul 2007 04:45:39 GMT
Hi Craig,

> > @PersistenceCapable
> > public class MyClass
> > {
> >     @Persistent(persistenceModifier=FieldPersistenceModifier.NONE)
> > }
> Doesn't bother me as much as duplicating Field/Property all over.

Me neither, but have to play devils advocate ;-)

> This is another anomaly: FieldPersistenceModifier should become
> PersistenceModifier.

+1. 
It was a hangover from when I originally had ClassPersistenceModifier and 
FieldPersistenceModifier.

> How about creating a new tag like @NotPersistent. To go along with
> @Transactional and @Persistent.

@Transient is already there :-)

The only place that "persistenceModifier" would then be used is in the 
specification of persistence of embedded objects, or overriding inherited 
fields - so the user may wish to *not* persistent a particular field. In this 
case they would have to use @Persistent(persistenceModifier=NONE)




Overriding inherited fields :-
One other area if you really want to provide annotations with the full 
capability that XML has. In XML you can override (inherited) fields 
persistence specifications in subclasses. With Annotations this currently 
isn't possible. This could be remedied by changing the specification of 
@Field/@Property (@Persistent) to be for  ElementType.TYPE too.

-- 
Andy  (Java Persistent Objects - http://www.jpox.org)

Mime
View raw message