-->
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: no equals method generated
PostPosted: Mon May 15, 2006 2:42 am 
Regular
Regular

Joined: Mon Mar 06, 2006 6:18 am
Posts: 95
Location: Bern, Switzerland
Hi all

i've added some meta tags to my hibernate mapping file:

Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated 15.05.2006 08:23:47 by Hibernate Tools 3.1.0.beta5 -->
<hibernate-mapping>
    <class name="najsre7.model.Benutzer" table="TBENUTZER" schema="NAJSRE7_WEB">
        <id name="id" type="java.lang.Integer">
            <column name="ILAUFNUMMER" precision="9" scale="0" />
            <generator class="sequence">
                <param name="sequence">SEQ_TBENUTZER</param>
            </generator>
        </id>
        <timestamp name="mutDatum" column="DMUTDAT" />
        <many-to-one name="benutzerStatus" class="najsre7.model.BenutzerStatus" fetch="select">
            <column name="FK_TBENUSTAT_ISTATUS" precision="9" scale="0" not-null="true" />
        </many-to-one>
        <property name="benutzerName" type="java.lang.String">
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
            <column name="SBENUTZERNAME" length="50" not-null="true" />
        </property>
        <property name="passwort" type="java.lang.String">
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
            <column name="SPASSWORT" length="50" not-null="true" />
        </property>
        <property name="EMail" type="java.lang.String">
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
            <column name="SEMAIL" length="50" not-null="true" />
        </property>
        <property name="lastLogin" type="timestamp">
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
            <column name="DLASTLOGIN" length="11" />
        </property>
        <property name="anzahlLogin" type="java.lang.Integer">
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
            <column name="IANZLOGIN" precision="9" scale="0" not-null="true" />
        </property>
        <property name="mutUser" type="java.lang.String">
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
            <column name="SMUTUSER" length="10" not-null="true" />
        </property>
        <property name="stvUser" type="java.lang.String">
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
            <column name="SSTVUSER" length="10" />
        </property>
        <property name="personId" type="java.lang.Integer">
            <meta attribute="use-in-tostring">true</meta>
            <meta attribute="use-in-equals">true</meta>
            <column name="FK_TPER_IPERSNR" precision="9" scale="0" not-null="true" />
        </property>
        <set name="zugaenge" inverse="true">
            <key>
                <column name="FK_TBENU_ILAUFNR" precision="22" scale="0" />
            </key>
            <one-to-many class="najsre7.model.Zugang" />
        </set>
         <set name="profile" table="TBENU_PROFIL_MATRIX"  fetch="join" cascade="all"  >
          <key column="FK_TBENU_ILAUFNR" />
          <many-to-many column="FK_TPROFIL_ILAUFNR" class="najsre7.model.Profil" />
      </set>
    </class>
</hibernate-mapping>


If i generate my model classes no toString and equals methods will be generated. What am i doing wrong? Here is my ant task:

Code:
   <hibernatetool destdir="${dest.dir}">
      
         <jdbcconfiguration
            configurationfile="conf/hibernateTools/hibernate.cfg.xml"
            revengfile="conf/hibernateTools/hibernate.reveng.xml"
            reversestrategy="hibernate.NajsReverseEngineeringStrategy"
         />   
          
        <hbm2hbmxml   
            templatepath="src/najsTemplates"/>

         <hbm2java jdk5="false" ejb3="false" />
          
      </hibernatetool>


Regards
Angela


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 15, 2006 7:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
don't use jdbcconfiguration if you don't want the mappings automatically built from the jdbc.

Use <configuration> and point it to your mappings.

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