You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Justin Musgrove <JM...@fcci-group.com> on 2006/02/23 13:43:17 UTC
Result Map Extends/
I am new to Ibatis and it rocks (ok, enough sucking up :)
Two questions:
1. I am trying to maintain one resultmap with all the properties. If I
extend to additional resultMap to add groupby property I get the error
below.
Cause: org.xml.sax.SAXParseException: The content of element
type "resultMap" is incomplete, it must match
"(result+,discriminator?)".
<resultMap id="address"
class="com.x.ods.domain.entity.address.Address" groupBy="entAddId">
<result column="ENT_ADD_ID" property="entAddId"
jdbcType="DECIMAL"/>
</resultMap>
<resultMap extends="address" id="addressGroupBy"
class="com.x.ods.domain.entity.address.Address" groupBy="entAddId"/>
I get the following error stating that a <result> is required. Is there
a work around for this?
2. If a column exists in a resultMap that doesn't exist in a <select>
the following error occurs. Is there a property that allows the column
to be ignored if it doesn't exist in the select?
com.ibatis.common.jdbc.exception.NestedSQLException:
--- The error occurred in com/x/ods/dao/ibatis/sqlmaps/Entity.xml.
--- The error occurred while applying a result map.
--- Check the ODS.entityComposite.
--- Check the result mapping for the 'srcSystem' property.
--- Cause: java.sql.SQLException: Invalid column name
Any help is appreciated. Thanks.
Justin
Re: Result Map Extends/
Posted by Sven Boden <li...@pandora.be>.
For question
1) Currently not: you need to have at least 1 result as in <!ELEMENT
resultMap (result+, discriminator?)>. Short term solution would be just
to copy your ResultMap
2) Also not supported yet. JIRA IBATIS-216 is open for this:
http://issues.apache.org/jira/browse/IBATIS-216
Regards,
Sven
Justin Musgrove wrote:
>I am new to Ibatis and it rocks (ok, enough sucking up :)
>
>Two questions:
>
>1. I am trying to maintain one resultmap with all the properties. If I
>extend to additional resultMap to add groupby property I get the error
>below.
>
> Cause: org.xml.sax.SAXParseException: The content of element
>type "resultMap" is incomplete, it must match
>"(result+,discriminator?)".
>
> <resultMap id="address"
>class="com.x.ods.domain.entity.address.Address" groupBy="entAddId">
> <result column="ENT_ADD_ID" property="entAddId"
>jdbcType="DECIMAL"/>
> </resultMap>
>
> <resultMap extends="address" id="addressGroupBy"
>class="com.x.ods.domain.entity.address.Address" groupBy="entAddId"/>
>
>
>I get the following error stating that a <result> is required. Is there
>a work around for this?
>
>
>
>2. If a column exists in a resultMap that doesn't exist in a <select>
>the following error occurs. Is there a property that allows the column
>to be ignored if it doesn't exist in the select?
>com.ibatis.common.jdbc.exception.NestedSQLException:
>
>--- The error occurred in com/x/ods/dao/ibatis/sqlmaps/Entity.xml.
>
>--- The error occurred while applying a result map.
>
>--- Check the ODS.entityComposite.
>
>--- Check the result mapping for the 'srcSystem' property.
>
>--- Cause: java.sql.SQLException: Invalid column name
>
>
>Any help is appreciated. Thanks.
>
>Justin
>
>
>