ibatis可以动态注入sql吗
2个回答
展开全部
<typeAlias alias="author" type="com.ibatis.Author"/>
<resultMap id="authorResult" class="author">
<result property="id" column="ID"/>
<result property="name" column="NAME"/>
<result property="address" column="ADDRESS"/>
<result property="gender" column="GENDER"/>
<result property="age" column="AGE"/>
</resultMap>
<select id="getAllAuthor" resultMap="accountResult" >
select $fieldname$ from author
</select>
再检查com.ibatis.Author是否属性都对应上了。
<resultMap id="authorResult" class="author">
<result property="id" column="ID"/>
<result property="name" column="NAME"/>
<result property="address" column="ADDRESS"/>
<result property="gender" column="GENDER"/>
<result property="age" column="AGE"/>
</resultMap>
<select id="getAllAuthor" resultMap="accountResult" >
select $fieldname$ from author
</select>
再检查com.ibatis.Author是否属性都对应上了。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询