-->
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.  [ 4 posts ] 
Author Message
 Post subject: mapping 2-d-Arrays
PostPosted: Wed Aug 25, 2004 10:25 am 
Newbie

Joined: Fri Aug 20, 2004 8:26 am
Posts: 5
Location: Karlsruhe, Germany
Hello,

I didn't find anything about it in the forum nor in the docs: is it possible to persist a 2d-array like
[quote]Cat[][] catArray;[/quote]?
I know it works with
[quote]<property name="catArray" type="serializable">[/quote]
This requires Cat being serializable. Is there any other way?

Or is there a way to persist it like an array with
[quote]
<array name="catArray">
<key column="holder"/>
<index column="position"/>
<many-to-many class="Cat"/>
</array>
[/quote]?
If the index (position-column) would hold tuples like (1, 1) (1, 2) instead of simple integers, this could work, couldn't it?

Thanks,
Alice


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 25, 2004 11:15 am 
Regular
Regular

Joined: Wed Aug 18, 2004 5:16 am
Posts: 69
Location: Modena, Italy
Try to consider your 2d-array as a collection of collections, this can help


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 25, 2004 3:37 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
No this can not help.

I don't know of any really good way to map this. Rethink your data structure probably.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 26, 2004 6:54 am 
Newbie

Joined: Fri Aug 20, 2004 8:26 am
Posts: 5
Location: Karlsruhe, Germany
Thanks for the answer.
Unfortunately I can't rethink my data structure - it's legacy data. So it will have to work with serialization. Are 2d-arrays that rare (no mapping tool I know supports multidimensional arrays)?
Does it mean lots of work to alter the array-index element in the mapping file so that it can manage tuples?
Have a nice day,
Alice


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

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.