-->
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: hbm2hbmxml don't take into account revengfile-using Oracle9i
PostPosted: Fri Jan 15, 2010 8:22 am 
Newbie

Joined: Fri Jan 15, 2010 7:43 am
Posts: 2
My configuration:

1) Ant target:

<taskdef name="hibernatetool"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="project.classpath">
</taskdef>

<target name="reverse" description="Produces XML mapping files from DB schema">
<hibernatetool destdir="${src.java.dir}">
<jdbcconfiguration
propertyfile="${basedir}/build/helloworld.db.properties"
revengfile="${basedir}/build/helloworld.reveng.xml"/>

<hbm2cfgxml/>
<hbm2hbmxml/>
</hibernatetool>
</target>


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering
SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

<hibernate-reverse-engineering>
<table-filter match-name="message" package="mapping_with_xml.from_DB_2_pojo.hello" exclude="false"/>

2) revengfile
<table name="MESSAGE" class="Message">
<primary-key>
<generator class="increment" />
<key-column name="MESSAGE_ID" property="id" type="Long" />
</primary-key>
<column name="MESSAGE_TEXT" property="text" />
<foreign-key constraint-name="FK_NEXT_MESSAGE">
<many-to-one property="nextMessage" />
<set exclude="true" />
</foreign-key>
</table>
</hibernate-reverse-engineering>

3) risultato di helloworld.hbm.xml
<?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-gen-2010 11.19.22 by Hibernate Tools 3.2.4.GA -->
<hibernate-mapping>
<class name="mapping_with_xml.from_DB_2_pojo.hello.Message" table="MESSAGE" schema="HIBERNATE">
<id name="messageId" type="big_decimal">
<column name="MESSAGE_ID" scale="0" />
<generator class="assigned" />
</id>
<many-to-one name="nextMessage" class="mapping_with_xml.from_DB_2_pojo.hello.Message" fetch="select">
<column name="NEXT_MESSAGE_ID" scale="0" />
</many-to-one>
<property name="messageText" type="string">
<column name="MESSAGE_TEXT" />
</property>
</class>
</hibernate-mapping>

as you can see none of the settings put on revengfile has been taken into account.

I heard to put the default_schema on hibernate.cfg.xml but nothing changes.


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.