本文整理了Java中org.apache.ibatis.plugin.Plugin
类的一些代码示例,展示了Plugin
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin
类的具体详情如下:
包路径:org.apache.ibatis.plugin.Plugin
类名称:Plugin
暂无
代码示例来源:origin: pagehelper/Mybatis-PageHelper
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
代码示例来源:origin: camunda/camunda-bpm-platform
public static Object wrap(Object target, Interceptor interceptor) {
Map<Class<?>, Set<Method>> signatureMap = getSignatureMap(interceptor);
Class<?> type = target.getClass();
Class<?>[] interfaces = getAllInterfaces(type, signatureMap);
if (interfaces.length > 0) {
return Proxy.newProxyInstance(
type.getClassLoader(),
interfaces,
new Plugin(target, interceptor, signatureMap));
}
return target;
}
代码示例来源:origin: org.mybatis/mybatis
public static Object wrap(Object target, Interceptor interceptor) {
Map<Class<?>, Set<Method>> signatureMap = getSignatureMap(interceptor);
Class<?> type = target.getClass();
Class<?>[] interfaces = getAllInterfaces(type, signatureMap);
if (interfaces.length > 0) {
return Proxy.newProxyInstance(
type.getClassLoader(),
interfaces,
new Plugin(target, interceptor, signatureMap));
}
return target;
}
代码示例来源:origin: pagehelper/Mybatis-PageHelper
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
代码示例来源:origin: org.apache.ibatis/ibatis-core
public static Object wrap(Object target, Interceptor interceptor) {
Map<Class, Set<Method>> signatureMap = getSignatureMap(interceptor);
Class type = target.getClass();
Class[] interfaces = getAllInterfaces(type, signatureMap);
if (interfaces.length > 0) {
return Proxy.newProxyInstance(
type.getClassLoader(),
interfaces,
new Plugin(target, interceptor, signatureMap));
}
return target;
}
代码示例来源:origin: baomidou/mybatis-plus
@Override
public Object plugin(Object target) {
if (target instanceof Executor) {
return Plugin.wrap(target, this);
}
return target;
}
代码示例来源:origin: baomidou/mybatis-plus
@Override
public Object plugin(Object target) {
if (target instanceof Executor) {
return Plugin.wrap(target, this);
}
return target;
}
代码示例来源:origin: baomidou/mybatis-plus
@Override
public Object plugin(Object target) {
if (target instanceof StatementHandler) {
return Plugin.wrap(target, this);
}
return target;
}
代码示例来源:origin: baomidou/mybatis-plus
@Override
public Object plugin(Object target) {
if (target instanceof StatementHandler) {
return Plugin.wrap(target, this);
}
return target;
}
代码示例来源:origin: baomidou/mybatis-plus
@Override
public Object plugin(Object target) {
if (target instanceof StatementHandler) {
return Plugin.wrap(target, this);
}
return target;
}
代码示例来源:origin: wuyouzhuguli/FEBS-Shiro
@Override
public Object plugin(Object arg0) {
return Plugin.wrap(arg0, this);
}
代码示例来源:origin: a466350665/smart
/**
* 只拦截这两种类型的 <br>
* StatementHandler <br>
* ResultSetHandler
*
* @param target
* @return
*/
@Override
public Object plugin(Object target) {
if (target instanceof StatementHandler || target instanceof ResultSetHandler) {
return Plugin.wrap(target, this);
}
else {
return target;
}
}
代码示例来源:origin: hs-web/hsweb-framework
@Override
public Object plugin(Object target) {
if (target instanceof StatementHandler) {
StatementHandler statementHandler = (StatementHandler) target;
MetaObject metaStatementHandler = SystemMetaObject.forObject(statementHandler);
String sql = statementHandler.getBoundSql().getSql();
Pager pager = Pager.getAndReset();
String newSql = sql;
if (sql.trim().toLowerCase().startsWith("select")) {
if (pager != null) {
newSql = EasyOrmSqlBuilder.getInstance()
.getActiveDatabase().getDialect()
.doPaging(sql, pager.pageIndex(), pager.pageSize());
}
Object queryEntity = statementHandler.getParameterHandler().getParameterObject();
if (queryEntity instanceof QueryParam && ((QueryParam) queryEntity).isForUpdate()) {
newSql = newSql + " for update";
}
metaStatementHandler.setValue("delegate.boundSql.sql", newSql);
}
}
return Plugin.wrap(target, this);
}
代码示例来源:origin: zhangxd1989/springboot-dubbox
@Override
public Object plugin(Object target) {
if (target instanceof Executor) {
return Plugin.wrap(target, this);
} else {
return target;
}
}
代码示例来源:origin: Meituan-Dianping/Zebra
@Override
public Object plugin(Object target) {
if (target instanceof Executor) {
return Plugin.wrap(target, this);
} else {
return target;
}
}
代码示例来源:origin: xianrendzw/EasyReport
@Override
public Object plugin(final Object target) {
if (target instanceof Executor) {
return Plugin.wrap(target, this);
}
return target;
}
代码示例来源:origin: mybatis-book/book
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
代码示例来源:origin: pig4cloud/pig
/**
* 生成拦截对象的代理
*
* @param target 目标对象
* @return 代理对象
*/
@Override
public Object plugin(Object target) {
if (target instanceof StatementHandler) {
return Plugin.wrap(target, this);
}
return target;
}
代码示例来源:origin: mybatis-book/book
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
代码示例来源:origin: mybatis-book/book
@Override
public Object plugin(Object target) {
return Plugin.wrap(target, this);
}
内容来源于网络,如有侵权,请联系作者删除!