com.sicheng.common.persistence.proxy.PageConfiguration Maven / Gradle / Ivy
/**
* 本作品使用 木兰公共许可证,第2版(Mulan PubL v2) 开源协议,请遵守相关条款,或者联系sicheng.net获取商用授权。
* Copyright (c) 2016 SiCheng.Net
* This software is licensed under Mulan PubL v2.
* You can use this software according to the terms and conditions of the Mulan PubL v2.
* You may obtain a copy of Mulan PubL v2 at:
* http://license.coscl.org.cn/MulanPubL-2.0
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PubL v2 for more details.
*/
package com.sicheng.common.persistence.proxy;
import org.apache.ibatis.binding.MapperRegistry;
import org.apache.ibatis.session.Configuration;
import org.apache.ibatis.session.SqlSession;
/**
*
* 自定义Mybatis的配置,扩展.
*
*
* @author zhaolei
* @version 1.0 2012-05-13 上午10:06
*
*/
public class PageConfiguration extends Configuration {
protected MapperRegistry mapperRegistry = new PaginationMapperRegistry(this);
@Override
public void addMapper(Class type) {
mapperRegistry.addMapper(type);
}
@Override
public T getMapper(Class type, SqlSession sqlSession) {
return mapperRegistry.getMapper(type, sqlSession);
}
@Override
public boolean hasMapper(Class> type) {
return mapperRegistry.hasMapper(type);
}
}