-->
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.  [ 6 posts ] 
Author Message
 Post subject: Persisting string array String[]
PostPosted: Tue Aug 16, 2005 11:45 am 
Senior
Senior

Joined: Fri Jun 18, 2004 10:17 am
Posts: 140
Hi,

Quite a ridiculously simple question I am sure, I'm quite ashamed but I cannot find this in all 3 of my Hibernate books or google or these forums.

How do I go about mapping the persistence of a string array; String[]? I know it looks like a List<String> but I do need it to be a string array.

Thanks in advance, ADC


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 11:49 am 
Senior
Senior

Joined: Thu May 12, 2005 11:40 pm
Posts: 125
Location: Canada
<array>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 16, 2005 11:55 am 
Senior
Senior

Joined: Fri Jun 18, 2004 10:17 am
Posts: 140
see ;)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 8:28 am 
Newbie

Joined: Wed Sep 07, 2005 8:22 am
Posts: 14
can someone show me a full example of this please?

Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 11:06 am 
Newbie

Joined: Wed Sep 17, 2003 5:36 pm
Posts: 5
Can you be more clear? Are you mapping the String[] to a column in a table (e.g. storing all the values in one column) or are you storing each value in String[] in separate rows?

Ben


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 07, 2005 11:11 am 
Newbie

Joined: Wed Sep 07, 2005 8:22 am
Posts: 14
I did have a class that contained a member varible that was a String[] eg.

Code:
   private String[] relatedPartNumbers = {};

   /**
    *  @hibernate.property name="relatedPartNumbers" type="?????"
   */
   public String[] getRelatedPartNumbers() {
      return relatedPartNumbers;
   }

        etc...


I've now changed my design to reference other parts, rather than part numbers.

The main point of the test was to work out how to store String[] via Hibernate.

Thanks
Jeff


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