Having a table A and a table B, A has a fk to B. In A, column of this FK is unique and nullable. That means, a B is only referencied as a maximum for one A.
But hibernate tools reverse enginering is generating pojos as:
Pojo A with a field B. Ok, that's correct. Pobo B with a set of A. No, it's not, should be a single field A.
What's wrong? I'm missing something?
this is my reveng.xml
<?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>
<type-mapping>
<sql-type jdbc-type="BIGINT" hibernate-type="java.math.BigInteger" />
<sql-type jdbc-type="NUMERIC" precision="19" hibernate-type="java.math.BigInteger"/>
<sql-type jdbc-type="NUMERIC" precision="10" not-null="true" hibernate-type="int"/>
<sql-type jdbc-type="NUMERIC" precision="10" not-null="false" hibernate-type="java.lang.Integer"/>
<sql-type jdbc-type="NUMERIC" precision="4" not-null="true" hibernate-type="byte"/>
<sql-type jdbc-type="NUMERIC" precision="4" not-null="false" hibernate-type="java.lang.Byte"/>
<sql-type jdbc-type="OTHER" hibernate-type="timestamp"/>
</type-mapping>
<table-filter match-name="MLOG.*" exclude="true" />
<table-filter match-name="RUPD.*" exclude="true" />
<!-- Forzamos a que el id sea Integer. Al eliminar el autoincremental hibernate pasa este campo a int.-->
<!-- Se cambia el codigo para que no afecte el tipo-->
<!--
<table name="cpanel_bloque_canal" catalog="ob_cpanel">
<primary-key>
<key-column name="idBloque" type="java.lang.Integer"/>
</primary-key>
</table>
-->