You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Clinton Begin (JIRA)" <ib...@incubator.apache.org> on 2009/08/15 07:17:14 UTC

[jira] Closed: (IBATIS-624) Setter is expected if column name is same as property name

     [ https://issues.apache.org/jira/browse/IBATIS-624?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Clinton Begin closed IBATIS-624.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 3.0 Beta 2
         Assignee: Clinton Begin

Fixed

> Setter is expected if column name is same as property name
> ----------------------------------------------------------
>
>                 Key: IBATIS-624
>                 URL: https://issues.apache.org/jira/browse/IBATIS-624
>             Project: iBatis for Java
>          Issue Type: Bug
>          Components: SQL Maps
>    Affects Versions: 3.0 Beta 1 
>            Reporter: Gabriel Axel
>            Assignee: Clinton Begin
>             Fix For: 3.0 Beta 2
>
>
> When I try to map the result of a select statement to an immutable class, if a property name is the same as the column name I get an error for a missing setter.
> Example:
>  <resultMap type="test.Organization" id="organization">
> 	<constructor>
> 		<idArg column="organization_id" javaType="int"/>
> 		<arg column="name" javaType="String"/>
> 	</constructor>
> </resultMap>
> <select id="getOrganizations" resultMap="organization">
> 	<![CDATA[
> 		select organization_id, name from organizations
> 	]]>
> </select>
> public class Organization {
> 	private final int id;
> 	private final String name;
> 	
> 	public Organization(Integer id, String name) {
> 		this.id = id;
> 		this.name = name;
> 	}
>         // getters...
> }
> In the example above, the "id" field maps properly but I get a missing setter error for the "name" field, unless I rename the column in the select statement and in the result map.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ibatis.apache.org
For additional commands, e-mail: dev-help@ibatis.apache.org