I am working with a legacy database that uses composite keys. I created a composite identifier class, LotePrimaryKey, to use as the id for my Lote class. In LotePrimaryKey, I implement Serializable and override Equals and hashCode. My Lote.hbm.xml class (compiled as an embedded resource) is:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="siga.contabilidad.maestro.Lote" table="TBLOTE" schema="CONTABILIDAD">
<composite-id name="id" class="siga.contabilidad.maestro.LotePrimaryKey">
<key-property name="periodoContable" type="java.lang.String" column="CO_PERIODO" />
<key-property name="origenContable" type="java.lang.String" column="TI_ORIGEN" />
<key-property name="numeroLote" type="java.lang.Integer" column="CO_LOTE" />
</composite-id>
<property name="feLote" type="java.util.Date" update="true" insert="true">
<column name="FE_LOTE" not-null="false" sql-type="date" />
</property>
<property name="feCreacion" type="java.sql.Timestamp" update="true" insert="true">
<column name="FE_CREACION" not-null="false" sql-type="Timestamp"/>
</property>
<property name="coUsuCrea" type="java.lang.String" update="true" insert="true">
<column name="CO_USUCREA" not-null="false" sql-type="varchar(10)"/>
</property>
<property name="feModifica" type="java.sql.Timestamp" update="true" insert="true">
<column name="FE_MODIFICA" not-null="false" sql-type="timestamp"/>
</property>
<property name="coUsuModif" type="java.lang.String" update="true" insert="true">
<column name="CO_USUMODIF" not-null="false" sql-type="varchar(10)"/>
</property>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Lote.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
I get the following exception when generate db schema
D:\software\certicom\contabilidad\extension\build.xml:26: Schema text failed: component class not found: siga.contabilidad.maestro.LotePrimaryKey
Where am I going wrong?
|