I think this might be a bug. I have mapped a bean with a collection of elements in the following way
<class name="SubReporteCalidad" table="SRN_CLDAD">
<composite-id name="id" class="identifier.SubReporteCalidadId">
<key-property name="idReporte" type="java.lang.Long">
<column name="ID_REP" precision="10" scale="0" />
</key-property>
<key-property name="idProd" type="java.lang.Long">
<column name="ID_PROD" precision="10" scale="0" />
</key-property>
</composite-id>
...
<list name="detalleValores" table="SRN_CLDAD_PROP" cascade="all,delete-orphan">
<key>
<column name="ID_REP" precision="10" scale="0" not-null="true" />
<column name="ID_PROD" precision="10" scale="0" not-null="true" />
</key>
<list-index column="ID"/>
<composite-element class="DetalleValorCalidad">
<many-to-one name="propiedad" class="Propiedad" fetch="join" lazy="false">
<column name="ID_PRPDAD" precision="10" scale="0" not-null="true" />
</many-to-one>
<property name="valor" type="java.lang.Double">
<column name="VLOR" precision="10" scale="4" not-null="true"/>
</property>
</composite-element>
</list>
...
</class>
Now i try to do the following hql:
select dv.propiedad.id,dv.valor
from SubReporteCalidad src join src.detalleValores dv
but i get the next error:
org.hibernate.QueryException: could not resolve property: propiedad.id of: gob.osinerg.srn.common.bean.SubReporteCalidad
Now, i've found a work around. The solution was to make another join to the bean inside the composite-element, like this:
select pr.id,dv.valor
from SubReporteCalidad src join src.detalleValores dv
join dv.propiedad pr
but I'm wondering if this was intended behavior or is it a bug needing some fix? If it is a bug, how do i report it?
PD: I'm using hibernate-3.2.0.cr5 (with ojdbc14-9.0.2.0.0 oracle driver)
|