You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Ludovic Maitre <lu...@fr.oleane.com> on 2004/03/26 11:52:30 UTC
Possible to map a String[] attribute to multiple columns ?
Hello,
I haven't find a way to map an object with a string array to multples
columns in a table.
For example i want to have the following object :
class TestStringArray {
Long id;
String[] label = new String[5];
//accessors:
String[] getLabel(){...};
setLabel(String[] _label){...};
}
and the following table:
CREATE TABLE TEST_STRING_ARRAY (
//mapped to id
ID_TEST_STRING_ARRAY int(11) NOT NULL auto_increment,
//mapped to label[0]
LIB_TEST_STRING_ARRAY_FR char(40) default '',
//mapped to label[1]
LIB_TEST_STRING_ARRAY_EN char(40) default '',
//mapped to label[2]
LIB_TEST_STRING_ARRAY_IT char(40) default '',
//mapped to label[3]
LIB_TEST_STRING_ARRAY_DE char(40) default '',
//mapped to label[4]
LIB_TEST_STRING_ARRAY_ES char(40) default '',
PRIMARY KEY (ID_TEST_STRING_ARRAY)
) TYPE=MyISAM;
I have tried a lot of collection-descriptors declaration but nothing
seems to work and the reading of the source code doesn't indicate any
special thing to do with indexed/array properties who have a type like
'java.lang.String' (i suppose that an array of 'java.util.Date' isn't
feasible also) in the PersistentField implementations.
I have also read the docs but without finding any clue for the moment,
so thanks per advance for any response.
--
Ludovic Maître
Factory Productions | Tél: (33) 04 93 07 08 00
149, avenue des mimosas | Fax: (33) 04 93 07 04 02
06700 Saint-Laurent-du-Var (France) | Web: http://www.factory.fr
---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org