Hi Jeff,
There's a difference between basic fields and relationship fields.
Basic fields must be one of the field types listed in 2.1.1 at the
very end of the chapter. On the other hand, relationships must be
defined using the interface types not the class types.
Note that according to Java, the interfaces for the collections and
maps are NOT serializable although each of the implementing classes
IS serializable.
So even though you could imagine that the jpa implementation might
just accept the collection and map types as probably containing
serializable instances at runtime, there's nothing in the
specification that requires it.
Craig
On Mar 5, 2007, at 12:36 PM, jeff wrote:
> craIg,
>
> i posted to the alias you mentioned also, but either here or there,
> could you help interpret the section of the spec i mentioned? if
> it's not saying that we can use the four java collection interfaces
> to define persistent fields, what is it saying?
>
> thanks!
>
> Collection-valued persistent fields and properties must be defined
> in terms of one of the following collection-valued interfaces
> regardless of whether the entity class otherwise adheres to the
> JavaBeans method conventions noted above and whether field or
> property-based access is used: java.util.Collection, java.util.Set,
> java.util.List[4], java.util.Map.[5] For collection-valued
> persistent properties, type T must be one of these collection
> interface types in the method signatures above. Generic variants of
> these collection types may also be used (for example, Set<Order>).
>
> In addition to returning and setting the persistent state of the
> instance, the property accessor methods may contain other business
> logic as well, for example, to perform validation. The persistence
> provider runtime executes this logic when property-based access is
> used.
>
>
> Craig L Russell <Craig.Russell_at_Sun.COM> wrote:
> Hi Jon,
>
> This is a specification issue.
>
> You might consider commenting at ejb3-spec-feedback_at_sun.com and see
> what the experts have to say.
>
> Craig
>
> On Mar 4, 2007, at 8:08 PM, Sanjeeb Kumar Sahoo wrote:
>
> > It was never suggested that the interface be Serializable. The
> > field can use an implementation that's Serializable.
> >
> > Thanks,
> > Sahoo
> >
> > Jon Miller wrote:
> >> IMHO, it should be OK to use the List interface as long as it
> >> points to a class that implements Serializable. i.e. List
> >> property = ArrayList(); should work. Why should the
> >> interface have to be serializable? I don't like the idea of having
> >> to hard code it to a concrete type.
> >>
> >> Jon
>
> Craig Russell
> Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
> 408 276-5638 mailto:Craig.Russell_at_sun.com
> P.S. A good JDO? O, Gasp!
>
>
>
> It's here! Your new message!
> Get new email alerts with the free Yahoo! Toolbar.
Craig Russell
Architect, Sun Java Enterprise System
http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell_at_sun.com
P.S. A good JDO? O, Gasp!
- application/pkcs7-signature attachment: smime.p7s