org.apache.ibatis.plugin.Plugin.wrap()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(4.0k)|赞(0)|评价(0)|浏览(214)

本文整理了Java中org.apache.ibatis.plugin.Plugin.wrap()方法的一些代码示例,展示了Plugin.wrap()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Plugin.wrap()方法的具体详情如下:
包路径:org.apache.ibatis.plugin.Plugin
类名称:Plugin
方法名:wrap

Plugin.wrap介绍

暂无

代码示例

代码示例来源:origin: pagehelper/Mybatis-PageHelper

@Override
public Object plugin(Object target) {
  return Plugin.wrap(target, this);
}

代码示例来源:origin: pagehelper/Mybatis-PageHelper

@Override
public Object plugin(Object target) {
  return Plugin.wrap(target, this);
}

代码示例来源: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: xianrendzw/EasyReport

@Override
public Object plugin(final Object target) {
  if (target instanceof Executor) {
    return Plugin.wrap(target, this);
  }
  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: 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);
}

代码示例来源:origin: vakinge/jeesuite-libs

@Override
public Object plugin(Object target) {
  if (target instanceof Executor) {
    return Plugin.wrap(target, this);
  } else {
    return target;
  }
}

代码示例来源:origin: babylikebird/common-admin

@Override
public Object plugin(Object target) {
  if (target instanceof StatementHandler) {
    return Plugin.wrap(target, this);
  }
  return target;
}

代码示例来源:origin: com.baomidou/mybatis-plus-extension

@Override
public Object plugin(Object target) {
  if (target instanceof Executor) {
    return Plugin.wrap(target, this);
  }
  return target;
}

相关文章