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 Re: DISCUSS remove @Field and @Property; add @Persistent
Date Thu, 19 Jul 2007 18:15:21 GMT
Here's what would change if we got rid of @Field and @Property and  
used member as the term to refer to both.

1. Rename @Field to @Persistent and @Transient to @NotPersistent and  
@FieldPersistenceModifier to @PersistenceModifier

2. Delete @Property.

3. Change src/java/javax/jdo/annotations/Column.java:    String  
targetField() default "";
to src/java/javax/jdo/annotations/Column.java:    String targetMember 
() default "";

4. Change src/java/javax/jdo/annotations/Embedded.java:    String  
ownerField() default "";
to src/java/javax/jdo/annotations/Embedded.java:    String ownerMember 
() default "";

5. Change src/java/javax/jdo/annotations/Embedded.java:    Field[]  
fields() default {};
to src/java/javax/jdo/annotations/Embedded.java:    Persistent[ ]  
members() default {};

6. Change src/java/javax/jdo/annotations/FetchGroup.java:     
FetchField[] fields();
to src/java/javax/jdo/annotations/FetchGroup.java:    Persistent[]  
members();

7. Change src/java/javax/jdo/annotations/Field.java:     
FieldPersistenceModifier persistenceModifier()
to src/java/javax/jdo/annotations/Persistent.java:     
PersistenceModifier persistenceModifier()

8. Change src/java/javax/jdo/annotations/Field.java:    Class[]  
fieldTypes() default {};
to src/java/javax/jdo/annotations/Persistent.java:    Class[] types()  
default {};

9. Change src/java/javax/jdo/annotations/Field.java:    Class  
fieldType() default void.class;
to src/java/javax/jdo/annotations/Persistent.java:    Class type()  
default void.class;

10. Change src/java/javax/jdo/annotations/ForeignKey.java:    String 
[] fields() default {};
to src/java/javax/jdo/annotations/ForeignKey.java:    String[] fields 
() default {};

11. Change src/java/javax/jdo/annotations/Index.java:    String[]  
fields() default {};
to src/java/javax/jdo/annotations/Index.java:    String[] fields()  
default {};

12. Change src/java/javax/jdo/annotations/Serialized.java: * This is  
the same as specifying @Field(serialized="true").
to src/java/javax/jdo/annotations/Serialized.java: * This is the same  
as specifying @Persistent (serialized="true").

13. Change src/java/javax/jdo/annotations/Transactional.java: *  
"@Field(persistenceModifier=FieldPersistenceModifier.TRANSACTIONAL)".
to src/java/javax/jdo/annotations/Transactional.java: * "@Persistent 
(persistenceModifier=PersistenceModifier.TRANSACTIONAL)".

14. Change src/java/javax/jdo/annotations/Unique.java:    String[]  
fields() default {};
to src/java/javax/jdo/annotations/Unique.java:    String[] members()  
default {};

15. Change src/java/javax/jdo/annotations/Transient.java: * "@Field 
(persistenceModifier=FieldPersistenceModifier.NONE)".
to src/java/javax/jdo/annotations/NotPersistent.java: * "@Persistent 
(persistenceModifier=PersistenceModifier.NONE)".

There are lots of comments to change as well, but these are the code  
changes I found.

Craig

On Jul 19, 2007, at 8:56 AM, Craig L Russell wrote:

> Well, member didn't show up as a thesaurus entry, but I like it.
>
> Member does have a meaning in Java but I think the meaning is  
> consistent enough with "field or property" to consider. It also  
> means "or inner class" but I don' think that's a negative.
>
> We could also use @Persistent as the annotation but use member and  
> members as elements. I'll try some sample code and see what looks  
> good.
>
> Craig
>
> On Jul 19, 2007, at 7:42 AM, Michael Bouschen wrote:
>
>> 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:
>>>
>>>>> 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  
>>>> annotations
>>>> were added a longggg time ago.
>>>>
>>>> So why not @NotPersistent ?
>>>
>>> Sounds good. I'll take a closer look at using @Persistent and see  
>>> if everything can be made consistent.
>>>
>>> Thanks,
>>>
>>> Craig
>>>>
>>>> -- 
>>>> Andy  (Java Persistent Objects - http://www.jpox.org)
>>>
>>> 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 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!
>

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