Hello,
I'm trying to create 2 *.hbm files via reverse engineering.
My problem is, that the the hbm files are generated but without many-to-one relationship.
Code:
Used Env:
Eclipse: 3.4
Oracle: 9i
driver: ojdbc14.jar
hibernate: hibernate3.jar, hibernate-tools.jar
project.reveng.xml:
Code:
<table-filter match-name="ACFT_NOSE" match-schema="ODS_ADMIN1"></table-filter>
<table-filter match-name="ACFT_TAIL" match-schema="ODS_ADMIN1">
</table-filter>
<table catalog="ODS_ADMIN1" schema="ODS_ADMIN1" name="ACFT_TAIL"
class="com.ual.ods.hibernate.test222.AcftTail">
<primary-key></primary-key>
</table>
<table catalog="ODS_ADMIN1" schema="ODS_ADMIN1" name="ACFT_NOSE"
class="com.ual.ods.hibernate.test222.AcftNose">
<foreign-key foreign-catalog="ODS_ADMIN1" constraint-name="MOTHER"
foreign-table="ACFT_TAIL" foreign-schema="ODS_ADMIN1">
<column-ref local-column="TAIL_NBR" foreign-column="TAIL_NBR" />
<many-to-one property="child"/>
</foreign-key>
</table>
hibernate.cfg.xml:
Code:
<hibernate-configuration>
<session-factory>
<property name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property name="hibernate.connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="hibernate.connection.password">pass</property>
<property name="hibernate.connection.url">jdbc:oracle:thin:@localhost:1531:db1</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.default_schema">ODS_ADMIN1</property>
<property name="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="hibernate.default_catalog">ODS_ADMIN1</property>
</session-factory>
</hibernate-configuration>
Generated sample hbm:
Code:
<hibernate-mapping>
<class name="com.ual.ods.hibernate.test222.AcftNose" table="ACFT_NOSE">
<id name="noseNbr" type="java.lang.String">
<column name="NOSE_NBR" length="4" />
<generator class="assigned" />
</id>
<property name="tailNbr" type="java.lang.String">
<column name="TAIL_NBR" length="6" />
</property>
.
.
</class>
</hibernate-mapping>
----------------------------------------
but I expected:
Code:
<hibernate-mapping>
<class name="com.ual.ods.hibernate.test222.AcftNose" table="ACFT_NOSE">
<id name="noseNbr" type="java.lang.String">
<column name="NOSE_NBR" length="4" />
<generator class="assigned" />
</id>
<many-to-one name="acftTail" class="com.ual.ods.hibernate.AcftTail" fetch="select">
<column name="TAIL_NBR" length="6" />
</many-to-one>
.
.
<
</class>
</hibernate-mapping>
Please help me out? I am stuck badly.