-->
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.  [ 2 posts ] 
Author Message
 Post subject: Persisting a collection of Strings
PostPosted: Tue Jun 29, 2004 11:58 am 
Newbie

Joined: Wed Jan 14, 2004 11:29 am
Posts: 19
I'm using XDoclet to to mark up my classes for hibernate. I'm trying to persist a java.util.Colleection of java.lang.String. The documentation suggest that primitive types are automatically persisted.

However using the following code breaks and I cannot find any documentation or examples of how to do this.

If I change the class="java.lang.String" to one of my other persistable classes all works fine so how do you specify a java.lang.String?

/**
* @hibernate.list cascade="all-delete-orphan" name="viewedArticles" inverse="true"
*
* @hibernate.collection-key column="parent_id"
*
* @hibernate.collection-index column="viewedArticles_order"
*
* @hibernate.collection-one-to-many class="java.lang.String"
*/


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 01, 2004 4:27 am 
Newbie

Joined: Wed Jan 14, 2004 11:29 am
Posts: 19
The solution to the problem was:

/**
* @hibernate.list cascade="all-delete-orphan" name="viewedArticles" inverse="true"
*
* @hibernate.collection-key column="parent_id"
*
* @hibernate.collection-index column="viewedArticles_order"
*
* @hibernate.collection-element column="value" type="java.lang.String"
*/


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