most optimal wy to persisted list? [message #385744] |
Fri, 27 February 2009 03:41  |
Eclipse User |
|
|
|
Hi all...
I'm just wondering, for EclipseLink, what is the most optimal way to
persist List fields of an entity. The @BasicCollection does not include
persisting the index of the List elements (as far as I can tell) so when
the EntityManager is cleared or a new one which does not alreayd know
about the in-memory version of the List is used... the index values are
lost. In the current implementation, there are lists being serialized
to byte arrays and stored as LOB columns which is not... optimal :)
Any advice on this? Portability to other JPA providers is of little
concern, if any.
Thanks!
- Phillip
|
|
|
Re: most optimal wy to persisted list? [message #385747 is a reply to message #385744] |
Mon, 02 March 2009 09:55  |
Eclipse User |
|
|
|
JPA 2.0 and EclipseLink 2.0 will support ordered lists using an index
column in the database. BasicCollections will also be standardized as
ElementCollection mappings in JPA 2.0. The EclipseLink 2.0 builds already
have this functionality, and some of the functionality was in the 1.1
release.
The drawback with serializing is that you cannot query on the list values.
However, if you don't need to query the values, then there is probably
nothing wrong with serializing the list.
You can also map the list as a OneToMany in JPA 1.0, and define a class
for the value that also contains an index field to order the list by.
---
James
http://www.nabble.com/EclipseLink---Users-f26658.html
|
|
|
Powered by
FUDForum. Page generated in 0.24085 seconds