-->
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: hbm2java is overwriting a class file with an empty one.
PostPosted: Thu Oct 23, 2003 5:02 pm 
Newbie

Joined: Tue Sep 30, 2003 7:10 pm
Posts: 10
We're using hbm2java to create class files. When I set up a particular mapping, one of the class files gets overwritten.

Below, the file ValueObject.java that is created in the class mapping gets overwriten by a completely empty ValueObject.java. I'm assuming MapClass mapping is creating its own ValueObject.java.

What am I doing wrong here?


Code:
    <class name="KeyObject" table="ko">
        <id name="id" type="string" unsaved-value="null" >
            <column name="id" sql-type="char(32)" not-null="true"/>
            <generator class="uuid.hex"/>
        </id>
        <property name="name" type="string" not-null="true"/>
        <property name="someField" type="string" not-null="true"/>

    </class>

    <class name="ValueObject" table="vo">
        <id name="id" type="string" unsaved-value="null" >
            <column name="id" sql-type="char(32)" not-null="true"/>
            <generator class="uuid.hex"/>
        </id>
        <property name="name" type="string" not-null="true"/>
        <property name="someOtherField" type="string" not-null="true"/>
        <map name="stuff" lazy="true" >
            <key column="id"/>
            <index column="key" type="string"/>
            <element column="value" type="string"/>
        </map>
    </class>

    <class name="MapClass" table="mc">
        <id name="id" type="string" unsaved-value="null" >
            <column name="id" sql-type="char(32)" not-null="true"/>
            <generator class="uuid.hex"/>
        </id>
        <map name="kvMapping" lazy="true" >
            <key column="id"/>
            <composite-index class="KeyObject" >
                <key-property name="name"/>
                <key-property name="someField"/>
            </composite-index>
            <composite-element class="ValueObject" />

        </map>

        <property name="name" type="string" not-null="true"/>
        <property name="someOtherField" type="string" not-null="true"/>
    </class>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Oct 24, 2003 12:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm - sounds like a new suttle bug ;)

Plese make a JIRA entry with your example attached.

I know what is wrong - but need a minute or two to detect how to avoid the problem ;)

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