-->
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: Composite id & one to one Mapping
PostPosted: Mon Jul 05, 2004 10:27 am 
Newbie

Joined: Fri Jul 02, 2004 6:47 am
Posts: 12
Hi,
My DB structure is

ParentTable
id - PK
----

ChildTable (having composite PK)
id pk (same as parent)
lcle-cd pk
---

My mapping
Mapping - PARENT CLASS
<class name="Parent" table="ParentTable" lazy="false" mutable="false">
<id name="id" type="string">
<column name="ID" />
<generator class="assigned"/>
</id>
<bag name="lblList" lazy="false" inverse="true" >
<key column="ID"/>
<one-to-many class="CsdI18NObj"/> </bag>

</class>

Mapping - CHILD CLASS


<class name="CsdI18NObj" table="ChildTable">
<composite-id>
<key-property name="Id" column="ID"/>
<key-property name="lclCode" column="LCLE_CD"/> </composite-id>

<property name="lbl" column="LBL_TX" type="string"/>
</class>


<property name="lbl" column="LBL_TX" type="string"/>
</class>

My Java code

l = hibSession.createQuery("select p.id, p from Parent p left join fetch p.lblList ").list();

I am getting the foloowing exception

JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: -99999, SQLState: HY010
[7/5/04 19:54:50:505 IST] 2b9f595 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [IBM][CLI Driver] CLI0125E Function sequence error. SQLSTATE=HY010
[7/5/04 19:54:50:545 IST] 2b9f595 JDBCException W net.sf.hibernate.util.JDBCExceptionReporter SQL Error: -99999, SQLState: HY010
[7/5/04 19:54:50:545 IST] 2b9f595 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter [IBM][CLI Driver] CLI0125E Function sequence error. SQLSTATE=HY010
[7/5/04 19:54:50:545 IST] 2b9f595 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter Could not execute query
[7/5/04 19:54:50:545 IST] 2b9f595 JDBCException E net.sf.hibernate.util.JDBCExceptionReporter TRAS0014I: The following exception was logged COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0125E Function sequence error. SQLSTATE=HY010
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:267)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:209)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:455)
at COM.ibm.db2.jdbc.app.DB2ResultSet.getString2(DB2ResultSet.java:664)
at COM.ibm.db2.jdbc.app.DB2ResultSet.getString(DB2ResultSet.java:2316)
at com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getString(WSJdbcResultSet.java:1788)
at net.sf.hibernate.type.StringType.get(StringType.java:18)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:62)
at net.sf.hibernate.type.NullableType.nullSafeGet(NullableType.java:53)
at net.sf.hibernate.hql.QueryTranslator.getResultColumnOrRow(QueryTranslator.java:997)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:222)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.doList(Loader.java:955)
at net.sf.hibernate.loader.Loader.list(Loader.java:946)
at net.sf.hibernate.hql.QueryTranslator.list(QueryTranslator.java:846)
at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543)
at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:39)
at org.apache.jsp._HibernateTest._jspService(_HibernateTest.java:108)
at com.ibm.ws.webcontainer.jsp.runtime.HttpJspBase.service(HttpJspBase.java:89)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)



Please help as I am unable to find the exact problem even after reading many queries of the forum


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.