-->
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.  [ 5 posts ] 
Author Message
 Post subject: How to map a two dimensional array?
PostPosted: Thu Jan 29, 2004 9:17 pm 
Newbie

Joined: Thu Jan 29, 2004 9:06 pm
Posts: 6
Hi,

I have class with a two-dimensional array of booleans as a member.
How do I do I the O/R - mapping in Hibernate for this?

Basically, I would like to to have a table that looks like this:


Row Column Value
1 1 true
1 2 false
1 3 true
2 1 true
2 2 false
2 3 true
.
.
.

I know that I could use the "serializable" type for this, but then
the array is not readable in the database.

Another approach would be to have a set instead of a two-dim.
array. This set consists of Entry-Objects and every object has members
"row", "column" and "value". But for performance reasons I would like
to keep the 2-dim. array.


Bernd


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 1:13 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
There is no easy way. It's not doable as a primary feature.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 7:05 pm 
Newbie

Joined: Thu Jan 29, 2004 9:06 pm
Posts: 6
So, what's the complicated way?

Bernd


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 31, 2004 7:42 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Don't know about your specific perf reasons, but you may map it as a map or a set and build a non mapped 2 dim array in your java code.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jan 31, 2004 10:03 am 
Newbie

Joined: Thu Jan 29, 2004 9:06 pm
Posts: 6
Ok, that was my idea as well.
Thanks for your quick help.

Bernd


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.