ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikkapl <fo...@wp.pl>
Subject Re: [resultMap] related objects
Date Thu, 02 Apr 2009 13:25:42 GMT

Ingmar Lötzsch wrote:
>> You don't need a custom TypeHandler. But perhaps you have to provide
> more information.

I get exception:
--- Check the company.company-result.  
--- The error happened while setting a property on the result object.  
--- Cause: com.ibatis.sqlmap.client.SqlMapException: Error instantiating
collection property for mapping 'address'.  Cause:

I have Company.xml where is all typeAliases, resultMap, sql statement
I use useStatementNamespaces="true", so I must have <sqlMap

return getSqlMapClientTemplate().queryForList("company.getAll");

<select id="getAll" resultMap="company-result">
	c.company_id, c.companyname,
	a.address_id, a.street
FROM hh_companies c
LEFT JOIN hh_addresses a ON c.address_id = a.address_id
** all companies have its addresses; no null values

<resultMap id="address-result" class="Address">
	<result property="addressId" column="address_id" />
	<result property="street" column="street" />
<resultMap id="company-result" class="Company">
	<result property="companyId" column="company_id" />
	<result property="name" column="companyname" />
	<result property="address" javaType="Address"
resultMap="company.address-result" />

View this message in context: http://www.nabble.com/-resultMap--related-objects-tp22845356p22847806.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

View raw message