Hi All.
I am trying to reverse engineering some tables. All my tries to configure classes names and properties names ares unsuccessful. I am using Netbeans 8.0.2, Hibernate 4.3.1, PostgreSQL 9.3.5.2,
all on Mac OS Yosemite.
My files:
hibernage.cfg.xml
Code:
<hibernate-configuration>
<session-factory>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.url">jdbc:postgresql://localhost:5432/vvv</property>
<property name="hibernate.connection.username">vvv</property>
<property name="hibernate.default_catalog">vvv</property>
<property name="hibernate.default_schema">public</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.internal.classic.ClassicQueryTranslatorFactory</property>
</session-factory>
</hibernate-configuration>
hibernate.reveng.xml
Code:
<hibernate-reverse-engineering>
<schema-selection match-catalog="vvv" match-schema="public"/>
<table-filter match-name="tb_disciplina"/>
<table-filter match-name="tb_aluno"/>
<table-filter match-name="tb_professor"/>
<table-filter match-name="tb_sala"/>
<table-filter match-name="tb_disciplina_aluno"/>
<table name="tb_disciplina" schema="public" catalog="vvv" class="beans.Disciplina">
<primary-key>
<generator class="sequence">
<param name="table">tb_disciplina_disc_id_seq</param>
</generator>
<key-column name="disc_id" />
</primary-key>
<column name="disc_nm" property="nome" type="string" />
<column name="disc_carga" property="cargaHoraria" type="int" />
<foreign-key constraint-name="tb_disciplina_prof_id_fkey" >
<many-to-one property="professor" />
</foreign-key>
</table>
</hibernate-reverse-engineering>
I am trying to generate Hibernate Mapping Files and POJOs, with these configurations:
- JDK5
- EJB3
- Domain code (.java)
-NO XML Mapping (.hbm.xml)
Testing only in
tb_disciplina table. Only the foreign-key column have its name changed. All columns, including table, maintain
default (TbDisciplina, discNm, etc).
Thank you in advance.