Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » most optimal wy to persisted list?
most optimal wy to persisted list? [message #385744] Fri, 27 February 2009 08:41 Go to next message
Phillip Ross is currently offline Phillip RossFriend
Messages: 2
Registered: July 2009
Junior Member
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 14:55 Go to previous message
James Sutherland is currently offline James SutherlandFriend
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

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


James : Wiki : Book : Blog : Twitter
Previous Topic:ObjectTypeConverter problems
Next Topic:PersistenceUnitInfo xxx has transactionType JTA, but doesnt have jtaDataSource
Goto Forum:
  


Current Time: Tue Apr 23 13:53:43 GMT 2024

Powered by FUDForum. Page generated in 0.02285 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top