mybatis中的dao層接口是否能夠重載。。。。。

是不能夠重載的。。。java

在dao層中的接口:app

public interface BaseMapper<T> {

int deleteByPrimaryKey(Long id);


xml中的配置
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
select id, document_id, operateuser, destorytime, reason, remark,sn
from t_destory
where id = #{id,jdbcType=BIGINT}
</select>
經過以上兩個對比可知:  dao層中接口的方法名與xml中的標籤id值是一致的,因此一旦出現方法重載以後就可會出現相同的方法名,xml中的id也是重名的了,一運行系統就會報錯,,,,  因此mybaits中的dao層接口是不能進行方法重載的。。。。
相關文章
相關標籤/搜索