ibatis中resultMap的用法
- XML code
<resultMap id="routeEndpointResultMap" class="com.linkage.crm.csb.core.model.RouteEndpoint"> <result column="SERVICE_ID" property="currentEndpoint" select="defaultEndpointSpace.findDefaultEndpoint"/> </resultMap>
像这段配置,要怎样理解? select 我明白,是调用其他命名空间里的select语句。
但是clumn 和property 呢?
[解决办法]
property
属性property的值是mapped statement返回结果对象的Java Bean属性的名称(bean需要有get方法)。
column
属性column的值是ResultSet中字段的名称,说白了也就是数据库表的列名了