-->
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.  [ 1 post ] 
Author Message
 Post subject: using hbm2java on nested components
PostPosted: Wed Oct 06, 2004 7:11 pm 
Newbie

Joined: Mon Oct 04, 2004 2:07 pm
Posts: 3
hbm2java doesn't seem to recurse. As noted in the hibernate documentation, nesting components is not unusual. I can sucessfully use a nested component. My problem arises when I try to use hbm2java. If I use hbm2java on an hbm similar to the one below, it will generate Level1Comp.java, but not Level2Comp.java. If I then pull the Level2Comp component out of the Level1Comp component in the hbm then it will generate both. At this point I can revert to the hbm format I want and I have my java files too. Has anyone else come across this problem? Is there a cleaner way to deal with it?

Hibernate version: 2.1.6

Hibernate tools jar: hibernate-tools-2.1.2.jar

Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping
    PUBLIC "-//Hibernate/Hibernate Mapping DTD//EN"
    "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class
    name="happyClass"
    table="HAPPY_CLASS"
>
  <composite-id name="comp_id" class="HappyPK" unsaved-value="none">
    <meta attribute="default-value" inherit="true">new HappyPK()</meta>

    <key-property name="key1" column="KEY1" type="java.lang.String" length="16">
      <meta attribute="default-value" inherit="true">null</meta>
    </key-property>

    <key-property name="key2" column="KEY2" type="java.lang.String" length="16">
      <meta attribute="default-value" inherit="true">null</meta>
    </key-property>
  </composite-id>
  <component name="level1Comp" class="Level1Comp" update="true" insert="true">
    <property name="level1Property" type="java.sql.String" column="LEVEL1PROPERTY" update="true" insert="true" />

    <component name="level2Comp" class="Level2Comp update="true" insert="true">
      <property name="level2Property" type="java.sql.String" column="LEVEL2PROPERTY" update="true" insert="true"/>
    </component>
  </component>

</class>
</hibernate-mapping>


[/code]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.