-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Mapping collection to object array
PostPosted: Tue Aug 25, 2009 5:10 am 
Beginner
Beginner

Joined: Sun Oct 09, 2005 3:21 pm
Posts: 40
using Hibernate 3

Have POJO generated with XMLBeans which models unbounded child elements as an object array which presents a problem when mapping Collections in Hibernate. Whole idea behind persistent collections is to react to remove/add/set as delete/insert/update calls. Pushing a collection into an array defeats that idea.

XmlBeans doesn't allow generation with lists/collections only Array[]. JAXB might be an alternative since it seems to handle unbounded elements with List.

Persistent (actually populating the collection properties in the fetched element) is important to my design (have lazy equal to true) due the potential number of relationships pulled into property collections. Wondering if I could extend the AbstractPersistentCollection and return the array object as an Array[]? Maybe by:

getSnapshot - at the end instead of returning an ArrayList use the toArray() method
equalsSnapshot - always dirty since i don't want users to update collections anyways
.....

Ideas?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.