Mybatis

数据库字段和对象属性的映射

<?xml version="1.0" encoding="UTF-8" ?>  
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.daoPerson">

    <resultMap type="com.entity.ettPerson" id="Person">
        <result property="ID" column="ID" />
        <result property="name" column="name" />
        
    </resultMap>

    <insert id="add" parameterType="com.ettPerson">
        INSERT INTO t
        (ID,name
        )
        values(#{ID},#{name})
    </insert>

     


</mapper>  

 

posted on 2015-08-11 15:30  lypzxy  阅读(236)  评论(0编辑  收藏  举报