-->
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: how to set up list instead of set in reveng.xml file?
PostPosted: Wed Jun 21, 2006 9:06 am 
Newbie

Joined: Fri Jun 09, 2006 7:22 am
Posts: 8
Is there anyway for me to generate a <list> instead of a <set> tag in the hbm.xml file that gets generated using the <hbm2hbmxml > ant task ? I create a reverse engineering file which specifies the set definition, but i really want an ArrayList to be created eventually in the POJO file that are also exported using the mapping files. Currently if I don't manually edit the mapping files a HashSet() is created for the one-to-many relations.

Is there an easy way to achieve this? If the only way is to extend my own reverse engineering class where do I get documentation on HOW to do that. I would much prefer a simple set property in the cfg.xml file (or any other place).. or even an edit to the .ftl files (again I'll need to know HOW to do that also)



Hibernate version: 3.0

Mapping documents:
Reverse engineering file:
Code:
<table class="WorkflowUnit">
   <primary-key>
         <key-column name="workflow_id" />
         <key-column name="workunit_id" />
      </primary-key>
      <foreign-key constraint-name="UToF"  foreign-table="workflow" >
         <column-ref local-column="workflow_id" foreign-column="workflow_id" />
         <many-to-one property="workflow" exclude="false" />
         <set property="workflowUnits" exclude="false" />
      </foreign-key>

   </table>


Above is used to generate the mapping file:

Code:

<hibernate-mapping package="...">
    <class name="Workflow">
             .
.
.
<set name="workflowUnits" inverse="true">
            <key>
                <column name="workflow_id" not-null="true" />
            </key>
            <one-to-many class="WorkflowUnit" />
        </set>


Code between sessionFactory.openSession() and session.close():
NA

Full stack trace of any exception that occurs:
NA

Name and version of the database you are using:
NA

The generated SQL (show_sql=true):
NA

Debug level Hibernate log excerpt:
NA


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 21, 2006 9:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
to map a list you will also need to specify a index column.

I haven't added stuff (yet) that cannot be more or less deducted from jdbc metadata to reveng.

_________________
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.