| Author |
DISCUSS remove @Field and @Property; add @Persistent
|
|
| Craig L Russell 2007-07-18, 7:11 pm |
| | |
| Andy Jefferson 2007-07-18, 7:11 pm |
| Hi Craig,
> It might be a good time (as we're almost done with this) to replace
> @Field and @Property with @Persistent. That would make it easier to
> describe that either a field or property is being described.
While I agree totally with merging @Field and @Property, the use of=20
@Persistent is not appropriate.=20
@PersistenceCapable
public class MyClass
{
@Persistent(persistenceModifier=3DFieldP
ersistenceModifier.NONE)
String someFieldThatIsNotPersistent
}
so I tag a field that is not persistent with @Persistent ?
Any other idea for name? that suggests field/method/property ?
=2D-=20
Andy =A0(Java Persistent Objects - http://www.jpox.org)
| |
| Craig L Russell 2007-07-18, 7:11 pm |
| | |
| Craig L Russell 2007-07-18, 7:11 pm |
| | |
| Craig L Russell 2007-07-18, 7:11 pm |
| | |
| Craig L Russell 2007-07-18, 7:11 pm |
| | |
| Andy Jefferson 2007-07-19, 1:11 am |
| Hi Craig,
> 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.=20
It was a hangover from when I originally had ClassPersistenceModifier and=20
=46ieldPersistenceModifier.
> 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=20
specification of persistence of embedded objects, or overriding inherited=20
fields - so the user may wish to *not* persistent a particular field. In th=
is=20
case they would have to use @Persistent(persistenceModifier=3DNONE)
Overriding inherited fields :-
One other area if you really want to provide annotations with the full=20
capability that XML has. In XML you can override (inherited) fields=20
persistence specifications in subclasses. With Annotations this currently=20
isn't possible. This could be remedied by changing the specification of=20
@Field/@Property (@Persistent) to be for ElementType.TYPE too.
=2D-=20
Andy =A0(Java Persistent Objects - http://www.jpox.org)
| |
| Andy Jefferson 2007-07-19, 1:11 am |
| > 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.
except that we would need an @Fields (@Persistents ???) to allow an array
or maybe have "fields"/"properties" under @PersistenceCapable
=2D-=20
Andy =A0(Java Persistent Objects - http://www.jpox.org)
| |
| Craig L Russell 2007-07-19, 1:11 am |
| | |
| Andy Jefferson 2007-07-19, 7:11 am |
| > Have I ever told you how much I *hate* using @Transient to describe
> @NotPersistent? Transient is a serialization concept and I have no
> trouble with a field that is both transient and persistent. That is,
> not serialized but stored in the database. So calling something
> @Transient is a big ugly blotch. Because if it's really transient,
> you should mark it in the class as transient.
No. You never told me ;-) nor did anybody else object when those annotation=
s=20
were added a longggg time ago.
So why not @NotPersistent ?
=2D-=20
Andy =A0(Java Persistent Objects - http://www.jpox.org)
| |
| Craig L Russell 2007-07-19, 1:11 pm |
| | |
| Michael Bouschen 2007-07-19, 1:11 pm |
| Hi,
I agree @NotPersistent is better than @Transient. The term serialization
is already occupied by serialization and both concepts (serialization
and persistence) are orthogonal.
Are we still looking for a name for a new annotation replacing both
@Field or @Property or did @Persistent win the race?
How about @Member?
Regards Michael
> Hi Andy,
>
> On Jul 18, 2007, at 11:36 PM, Andy Jefferson wrote:
>
>
> Sounds good. I'll take a closer look at using @Persistent and see if
> everything can be made consistent.
>
> Thanks,
>
> Craig
>
> 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!
>
--
Tech@Spree Engineering GmbH Tel.: +49/(0)30/235 520-33
Buelowstr. 66 Fax.: +49/(0)30/217 520-12
10783 Berlin mailto:mbo.tech@spree.de
Geschaeftsfuehrung: Anna-Kristin Proefrock
Sitz Berlin, Amtsgericht Charlottenburg, HRB 564 52
| |
| Craig L Russell 2007-07-19, 1:11 pm |
| | |
| Craig L Russell 2007-07-19, 7:11 pm |
| |
|
|
|