I'm getting a malformed query when getting the relationaship 'asegurados' with the following configuration:
<hibernate-mapping package="com.metlife.mimet.emisiongmmi.entity"> <class name="Solicitud" table="SOLICITUD" schema="EMISION_WEB"> <id name="id" type="int"> <column name="ID_SOLICITUD" /> <generator class="native" /> </id> <set name="asegurados" table="ASEGURADO" lazy="false" cascade="all-delete-orphan"> <key column="ID_SOLICITUD" /> <one-to-many class="Asegurado" /> </set> </class> </hibernate-mapping>
'Asegurado' class is an inherited one... <hibernate-mapping package="com.metlife.mimet.emisiongmmi.entity" schema="PERSONA"> <class name="Persona" table="PERSONA" abstract="true"> <id name="id" type="int"> <column name="ID_PERSONA" /> <generator class="identity" /> </id> <discriminator column="TIPO_PERSONA" type="string"/> <subclass name="PersonaFisica" discriminator-value="FISICA" abstract="true"> <join table="FISICA" inverse="true"> <key column="ID_PERSONA"/> <property name="curp" type="string"> <column name="CURP" length="18" not-null="true" /> </property> </join> <subclass name="Asegurado" discriminator-value="FISICA" > <join table="ASEGURADO" schema="EMISION_WEB" inverse="true"> <key column="ID_ASEGURADO" /> <property name="fechaNacimiento" type="date"> <column name="FECHA_NACIMIENTO" length="10" /> </property> </join> </subclass> </subclass> </class> </hibernate-mapping>
So, hibernate is looking for my KEY column in the first class of the inheritance tree: select ... from PERSONA asegurados0_ inner join FISICA asegurados0_1_ ... inner join ASEGURADO asegurados0_2_ ... where asegurados0_.ID_SOLICITUD=?
ID_SOLICITUD IS NOT IN PERSONA, IS IN ASEGURADO TABLE.
The question is: How can I tell to hibernate where to look for that column?
THAKS IN ADVANCE!
TMM
|