On Wed, Jan 27, 2010 at 10:22 AM, datanucleus <[email protected]> wrote:
> A List follows the contract of java.util.List, hence obviously
> ordering should be preserved. Whether it is JDO or JPA, the whole
> point of transparent persistence - people shouldn't need to know
> anything about the persistence process, just use their objects as
> normal.

...except when it isn't transparent.

There are cases you should be cautious of:

 * In a heterogenous list, Blob and Text objects will be moved to the
end of the list.

 * List<Number>, List<Object>, or raw List fields that contain numbers
will find all numbers converted to Long no matter what they were
stored as.

 * The case of an empty list and a null list are not distinguished.  I
believe JDO/JPA's approach is to always construct an empty list.  You
can't store a null value for a List field.

 * Any concrete information about the List itself is lost.  If you
have a field of type List which holds a LinkedList, when you save and
load it you will have an ArrayList.

 * If you have a relationship mapped as a List, be careful serializing it.

Given the large number of configuration annotations and required
understanding of proxies, deatching, etc work... I would hardly call
JDO or JPA "transparent".  With even the minimum number of
annotations, JDO entities look like christmas trees!

Jeff

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to