-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to specify collection type for reverse engineering?
PostPosted: Wed Feb 15, 2006 11:11 am 
Newbie

Joined: Thu Sep 09, 2004 10:32 am
Posts: 1
Location: Raleigh NC, USA
First, I'm using Hibernate Tools 3.1.0 beta4 with Eclipse 3.1.2. I haven't provided any code or trace information since it is irrelevant to my question.

Can I specify the type of collection I would like to use for reverse engineering one-to-many relationships? Specifically, I would like to use <list> instead of the default <set> in my generated hbm.xml files and java.util.List in the corresponding POJOs.

I've looked at the tools documentation and I cannot find any reference to configuring this. However, I see that there are Velocity templates for doing this (hbm/list.hbm.vm) , but am not sure how the tools can be configured to use them. It seems I would have to configure this in either the hibernate.reveng.xml or I'd have to write a ReverseEngineeringStrategy, but the latter seems to only allow for naming attributes.

Is this even possible, or do I have to go in after generation and manually change sets to lists?

Thanks,

Mike


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 15, 2006 11:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
currently not possible.

remember that changing e.g. set to list requires you to also specify an index column....making the configuration even more hairy..;;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 23, 2006 12:47 pm 
Newbie

Joined: Thu Feb 23, 2006 12:39 pm
Posts: 1
try bag instead of set

My problem was that hessian does not like set.

Now i can work with List in java and with ArrayList in C#.


Code:
     <bag name="waren"
             cascade="all-delete-orphan"
            lazy="false">
         <key column="AF01_KOPF_ID" />
         <one-to-many class="org.appfuse.model.Ware"/>
      </bag>


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