-->
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: hbm2ddl with idbag & collection-type attribute
PostPosted: Mon Jun 12, 2006 10:01 pm 
Newbie

Joined: Wed Mar 29, 2006 8:42 pm
Posts: 7
Hibernate version: hibernate-tools 3.1.0.beta4

First off, I've been having all sorts of wonderful successes with this stuff. Hat's off. My idbag worked just fine, but it was creating java.util.Collections and I'm trying to change it to java.util.List. Does the collection-type attribute work? Or have I missed something? Is this even appropriate here? It seemed like it should be ok to me.

Code:
<idbag name="seeAlso" table="SeeAlso" cascade="all" collection-type="java.util.List">
         <collection-id column="id" type="long">
            <generator class="native" />
         </collection-id>
         <key column="topic_from" />
         <many-to-many column="topic_to" class="Topic" fetch="join" />
   </idbag>


This is the the error that I get.
Code:
Caused by: org.hibernate.MappingException: Custom type does not implement UserCollectionType: java.util.List


ditto if I try org.hibernate.type.ListType of course. Do I really need to do a user type here?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 13, 2006 12:41 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
collection-type is for providing your own handler for managing a collection. nothing to do with the codegen.

what you need is to add a <meta attribute="property-type">java.util.List</meta> then you should be fine.

_________________
Max
Don't forget to rate


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.