-->
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 String array to VARCHAR with <array> ?
PostPosted: Mon May 09, 2011 5:59 am 
Newbie

Joined: Mon May 02, 2011 10:46 am
Posts: 9
Hi,

I need to map the following data (excerpt from a POJO made from an
XSD using Castor framework, this code can't be modified):
public void setAdditionalEMail(java.lang.String[] additionalEMailArray)
{
_additionalEMailList.clear();
for (int i = 0; i < additionalEMailArray.length; i++) {
_additionalEMailList.add(additionalEMailArray[i]);
}
}
public java.lang.String[] getAdditionalEMail()
{
int size = _additionalEMailList.size();
java.lang.String[] mArray = new java.lang.String[size];
for (int index = 0; index < size; index++) {
mArray[index] = (String)_additionalEMailList.get(index);
}
return mArray;
}

into an ADDITIONAL_EMAIL column where the mail addresses concatenated
to each other with a ';', this will be stored in a single string (like for ex.:
"me.you@yahoo.fr;ik.jouw@hotmail.be;steve@gmail.com").

Do you think there's a way to convert a String[] with String[0] = "me.you@yahoo.fr",
String[1] = "ik.jouw@hotmail.be" etc... to a single VARCHAR string
'me.you@yahoo.fr;ik.jouw@hotmail.be' *without* using a custom type ? Using the
<array> mapping element maybe ?

Any idea ?
Thanks lot...
Regards,
Seb


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.