-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Bug with hql query on collections of non-mapped classes?
PostPosted: Fri Feb 08, 2008 12:32 pm 
Newbie

Joined: Fri Feb 08, 2008 12:23 pm
Posts: 2
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)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.