Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.1.3
I have two classes:
First class:
<hibernate-mapping>
<class name="serito.model.DaConsultaFmto" table="DA_FORMATO" discriminator-value="268">
<id name="idFormato" type="long" column="ID_FORMATO">
<generator class="identity"/>
</id>
<discriminator column="ID_ENTIDAD_DISENO" type="integer"/>
<property name="ubEntorno" type="elmonte.aej.hibernate.TrimmedStringType" column="UB_ENTORNO"/>
<property name="idObjetoNegocio" type="long" column="ID_OBJETO_NEGOCIO"/>
<property name="FCreacion" type="date" column="F_CREACION"/>
<property name="FVigencia" type="date" column="F_VIGENCIA"/>
<property name="fechaFin" type="date" column="FECHA_FIN"/>
<property name="estado" type="elmonte.aej.hibernate.TrimmedStringType" column="ESTADO"/>
<property name="idSuceso" type="long" column="ID_SUCESO"/>
</class>
</hibernate-mapping>
Second class:
<hibernate-mapping>
<class name="serito.model.DaEntidadFmto" table="DA_FORMATO" discriminator-value="131">
<id name="idFormato" type="long" column="ID_FORMATO">
<generator class="identity"/>
</id>
<discriminator column="ID_ENTIDAD_DISENO" type="integer"/>
<property name="ubEntorno" type="elmonte.aej.hibernate.TrimmedStringType" column="UB_ENTORNO"/>
<property name="idObjetoNegocio" type="long" column="ID_OBJETO_NEGOCIO"/>
<property name="FCreacion" type="date" column="F_CREACION"/>
<property name="FVigencia" type="date" column="F_VIGENCIA"/>
<property name="fechaFin" type="date" column="FECHA_FIN"/>
<property name="estado" type="elmonte.aej.hibernate.TrimmedStringType" column="ESTADO"/>
<property name="idSuceso" type="long" column="ID_SUCESO"/>
</class>
</hibernate-mapping>
The two classes are mapped to the same table, with a discriminator value.
The values are insert corecctly but when i get values with "from DaEntidadFmto" or with criteria i get ALL the values from the table. With discriminator 268 and 131.
I tried with polymorphism="explicit" but i get the same result.
Is there a solution other than create a filter?