Hi
I need some help in getting "load-collection" working, I have been trying this for hours now, but no help. Please check the below mapping file and error . Please check the "loadIface" SQL and "ifaceIds" property.
QosPath.hbm.xmlCode:
<hibernate-mapping>
<class entity-name="QosPath" name="com.xg.hibernate.hbm.qos.QosPath" table="QOS_PATH_VIEW_GUI">
<id name="id" type="long">
<column name="ID" precision="22" scale="0" />
<generator class="assigned" />
</id>
<property name="name" type="string">
<column name="NAME" length="32" />
</property>
<!--------------------------------------------------------------------------------------------!>
<set name="ifaceIds" >
<key/>
<one-to-many class="com.xg.hibernate.hbm.qos.IFaceId"/>
<loader query-ref="loadIface"/>
</set>
<!--------------------------------------------------------------------------------------------!>
<property name="nbrQosSessions" type="java.lang.Integer">
<column name="NBR_QOS_SESSIONS"/>
</property>
<property name="alarmThreshEnabled" type="java.lang.Boolean">
<column name="ALARM_THRESH_ENABLED"/>
</property>
</class>
[b]<sql-query name="loadIface">[/b]
<return alias="ifaceid" class="com.xg.hibernate.hbm.qos.IFaceId" />
<load-collection alias="ifaceids" role="QosPath.ifaceIds"/>
SELECT PL.ID as {ifaceid.parentId}, P.APN as {ifaceid.vpnId},
P.VPN as {ifaceid.apnId},
QPI.IFACE as {ifaceid.id}
FROM QOS_PATH_LOAD PL
INNER JOIN QOS_PATH_HEAD PH ON PL.ID = PH.ID
INNER JOIN QOS_PATH P ON PL.ID = P.ID
INNER JOIN QOS_PATH_REV REV_INIT ON P.INIT_REV = REV_INIT.ID
INNER JOIN QOS_PATH_REV REV_LAST ON P.REV = REV_LAST.ID
INNER JOIN QOS_PATH_IFACE QPI ON P.ID = QPI.PATH
where PL.ID = :id
</sql-query>
</hibernate-mapping>
IFaceId.hbm.xmlCode:
<hibernate-mapping>
<class name="com.xg.hibernate.hbm.qos.IFaceId">
<id name="id" type="long">
<column name="IFACE_ID"/>
</id>
<property name="parentId" type="long">
<column name="ID"/>
</property>
<property name="vpnId" type="long">
<column name="VPN_ID"/>
</property>
<property name="apnId" type="long">
<column name="APN_ID"/>
</property>
</class>
</hibernate-mapping>
I am getting the below error when trying to load this data
Quote:
Hibernate: select * from ( select this_.ID as ID14_0_, this_.NAME as NAME14_0_, this_.DESCRIPTION as DESCRIPT3_14_0_, this_.APN_ID as APN4_14_0_, this_.APN_NAME as APN5_14_0_, this_.VPN_ID as VPN6_14_0_, this_.VPN_NAME as VPN7_14_0_, this_.NBR_QOS_SESSIONS as NBR8_14_0_, this_.NBR_BKGND_SESSIONS as NBR9_14_0_, this_.MAX_TX_BW as MAX10_14_0_, this_.MAX_RX_BW as MAX11_14_0_, this_.MAX_QOS_TX_BW as MAX12_14_0_, this_.MAX_QOS_RX_BW as MAX13_14_0_, this_.MAX_BKGND_TX_BW as MAX14_14_0_, this_.MAX_BKGND_RX_BW as MAX15_14_0_, this_.CURR_QOS_TX_BW as CURR16_14_0_, this_.CURR_QOS_RX_BW as CURR17_14_0_, this_.AVAIL_QOS_TX_BW as AVAIL18_14_0_, this_.AVAIL_QOS_RX_BW as AVAIL19_14_0_, this_.COMMENTS as COMMENTS14_0_, this_.CREATED_BY as CREATED21_14_0_, this_.CREATED_ON as CREATED22_14_0_, this_.MODIFIED_BY as MODIFIED23_14_0_, this_.MODIFIED_ON as MODIFIED24_14_0_, this_.QOS_CAC_ENABLED as QOS25_14_0_, this_.ADMIN_BARRED as ADMIN26_14_0_, this_.PATH_BARRED as PATH27_14_0_, this_.ALARM_THRESH_ENABLED as ALARM28_14_0_ from HHMEFEP.QOS_PATH_VIEW_GUI this_ ) where rownum <= ?
Hibernate: SELECT PL.ID as ID15_0_, P.APN as VPN3_15_0_,
P.VPN as APN4_15_0_,
QPI.IFACE as IFACE1_15_0_
FROM QOS_PATH_LOAD PL
INNER JOIN QOS_PATH_HEAD PH ON PL.ID = PH.ID
INNER JOIN QOS_PATH P ON PL.ID = P.ID
INNER JOIN QOS_PATH_REV REV_INIT ON P.INIT_REV = REV_INIT.ID
INNER JOIN QOS_PATH_REV REV_LAST ON P.REV = REV_LAST.ID
INNER JOIN QOS_PATH_IFACE QPI ON P.ID = QPI.PATH
where PL.ID = ?
154398 [http-8400-3] INFO org.hibernate.type.LongType - could not read column value from result set: IFACE1_15_1_; Invalid column name
154402 [http-8400-3] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: 17006, SQLState: null
154402 [http-8400-3] ERROR org.hibernate.util.JDBCExceptionReporter - Invalid column name
Please help me, I have no idea on how to get this working.
-Gireesh