Joined: Fri Nov 17, 2006 9:16 am Posts: 6
|
I'm trying to map a inheritance using different hbm files.
I have a file name Orden.hbm.xml
<hibernate-mapping>
<class name="Orden" table="ORDEN" lazy="false">
<id name="id" column="ID" type="java.lang.Long" unsaved-value="null">
<generator class="increment"></generator>
</id>
<discriminator column="TIPO" type="string" />
<component name="audit" class="es.rbcdexia.argenval.Audit">
<property name="user" type="java.lang.String" column="USER_NAME" />
<property name="timestamp" type="custom-timestamp" column="TIMESTAMP" />
<property name="process" type="java.lang.String" column="PROCESS" />
</component>
</class>
</hibernate-mapping>
I want to use other mapping file named Transferencia.hbm.xml (not valid)
<subclass lazy="false" name="Transferencia" extends="Orden" discriminator-value="TRANSFERENCIA_COMUN">
<join table="TRANSFERENCIA">
<id name="id" column="ID" type="java.lang.Long" unsaved-value="null">
<generator class="increment"></generator>
</id>
<property name="concepto" column="CONCEPTO" type="java.lang.String"/>
<property name="fecha" type="java.sql.Date" column="FECHA" />
</join>
</subclass>
hibernate.cfg.xml:
<mapping resource="Orden.hbm.xml"/>
<mapping resource="Transferencia.hbm.xml"/>
But this aproach doesn't work.
It's posible to map a inheritance in diferents mapping files. If it's possible how can I do it?
Thanks
Note: I can do it in one mapping file, but I have a complex inheritance with other classes and mapping files and I would like to divide in several files
|
|