Hello,
I need to add some custom/already generated .hbm.xml to the reveng.xml session.
Currently I do something like:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
<hibernate-reverse-engineering>
<schema-selection match-schema="public" />
<type-mapping>
<sql-type jdbc-type="BIGINT" hibernate-type="java.lang.Long" />
<sql-type jdbc-type="INTEGER" hibernate-type="java.lang.Integer" />
</type-mapping>
<table-filter match-name="lead" match-schema="public" exclude="false" />
<table-filter match-name="contact_.*" match-schema="public" exclude="false" />
<table name="contact_record">
<primary-key>
<generator class="sequence">
<param name="table">contact_record_id_contact_record_seq</param>
</generator>
</primary-key>
</table>
<table name="contact_record_data">
<primary-key>
<generator class="sequence">
<param name="table">contact_record_data_id_contact_record_data_seq</param>
</generator>
</primary-key>
</table>
<table name="contact_type">
<primary-key>
<generator class="sequence">
<param name="table">contact_type_id_contact_type_seq</param>
</generator>
</primary-key>
</table>
<table name="contact_type_category">
<primary-key>
<generator class="sequence">
<param name="table">contact_type_category_id_contact_type_category_seq</param>
</generator>
</primary-key>
</table>
<table name="contact_life_cycle">
<primary-key>
<generator class="sequence">
<param name="table">contact_life_cycle_id_contact_life_cycle_seq</param>
</generator>
</primary-key>
</table>
<table name="contact_life_cycle_category">
<primary-key>
<generator class="sequence">
<param name="table">contact_life_cycle_category_id_contact_life_cycle_category_seq</param>
</generator>
</primary-key>
</table>
<table name="contact_life_cycle_data">
<primary-key>
<generator class="sequence">
<param name="table">contact_life_cycle_data_id_contact_life_cycle_data_seq</param>
</generator>
</primary-key>
</table>
<table name="contact_life_cycle_status">
<primary-key>
<generator class="sequence">
<param name="table">contact_life_cycle_status_id_contact_life_cycle_status_seq</param>
</generator>
</primary-key>
</table>
</hibernate-reverse-engineering>
And works right because the table contact_record got it's foreign key recognized:
Code:
<hibernate-mapping>
<class name="com.level2.enterprise.hibernate.generated.ContactRecord" table="contact_record">
<id name="idContactRecord" type="java.lang.Integer">
<column name="id_contact_record" />
<generator class="sequence">
<param name="table">contact_record_id_contact_record_seq</param>
</generator>
</id>
...
<many-to-one name="lead" class="com.level2.enterprise.hibernate.generated.Lead" fetch="select">
<column name="uuid" not-null="true" />
</many-to-one>
<many-to-one name="contactType" class="com.level2.enterprise.hibernate.generated.ContactType" fetch="select">
<column name="id_contact_type" not-null="true" />
</many-to-one>
<property name="idShop" type="java.lang.Integer">
<column name="id_shop" />
</property>
...
</class>
</hibernate-mapping>
But this class
"Lead" was generated in another package so I have to remove manually.
Also the column
idShop has a foreign key to another column that's not present in the reveng.xml file because as Lead is already generated.
The question is:
How can I add the already generated classes to the reveng.xml configuration or eclipse configuration?
I want to add the .hbm.xml files so it has everything to work with without the need of adding actual tables to reveng environment.
Thank you in advance.