-->
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: Help required on "load-collection", Please help
PostPosted: Tue Jul 21, 2009 3:34 pm 
Newbie

Joined: Sun Jul 12, 2009 11:31 pm
Posts: 2
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.xml
Code:
<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.xml
Code:
<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


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.