ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Firas Adiler" <tapes...@idigna.com>
Subject RE: Very Urgent-Badly need you people Help
Date Fri, 28 Jul 2006 11:53:31 GMT
Hi,
 
Are you expecting more than one result from your query? If "Yes", then
queryForList/queryForMap is the proper method to call.
 
</Firas>

  _____  

From: rambabu.piridi@wipro.com [mailto:rambabu.piridi@wipro.com] 
Sent: Friday, July 28, 2006 10:47 AM
To: user-java@ibatis.apache.org
Subject: Very Urgent-Badly need you people Help


Hi,
Can any one please spend some time for this. I have to deliver the code
today.
 
I am doing lazy loading. I am doing basically N+1 loading. I have two tables
which has 1:N relationship.
If the table have the data with 1:1 ratio then my query is working fine.
 
But if any of master is having more than one detail record then it is
throwing the following error.
--- Check the result mapping for the 'properties' property.  

--- Cause: java.sql.SQLException: Error: executeQueryForObject returned too
many results.

 

Here i am giving the my mapping file.
 
<resultMap id="userMapOne" class="user">

<result property="userid" column="USR_ID"/>

<result property="role" column="ROLE_ID"/> 

<result property="description" column="DESCRIPTION"/> 

<result property="properties" column="USR_ID" select="select2" />

</resultMap>

( I have set method for properties attribute and this accepts object of type
property) 

<resultMap id="userMapTwo" class="property">

<result property="userid" column="USR_ID"/>

<result property="propertyname" column="PROPERTY_NAME"/> 

<result property="propertyvalue" column="PROPERTY_VALUE"/> 

</resultMap>

<statement id="RamBabu" resultMap="userMapOne"> 

     select * from USR_BASIC_INFO

</statement> 

<statement id="select2" resultMap="userMapTwo"> 

   select * from USR_EXTENSION_INFO where USR_ID=#userid#

</statement> 

 
thanks.
 
 
 

The information contained in this electronic message and any attachments to
this message are intended for the exclusive use of the addressee(s) and may
contain proprietary, confidential or privileged information. If you are not
the intended recipient, you should not disseminate, distribute or copy this
e-mail. Please notify the sender immediately and destroy all copies of this
message and any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should
check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com
	

Mime
View raw message