org.apache.ibatis.session.Configuration.getTypeHandlerRegistry()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(178)

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

Configuration.getTypeHandlerRegistry介绍

暂无

代码示例

代码示例来源:origin: Activiti/Activiti

public void initMybatisTypeHandlers(Configuration configuration) {
 configuration.getTypeHandlerRegistry().register(VariableType.class, JdbcType.VARCHAR, new IbatisVariableTypeHandler());
}

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

public MybatisDefaultParameterHandler(MappedStatement mappedStatement, Object parameterObject, BoundSql boundSql) {
  super(mappedStatement, processBatch(mappedStatement, parameterObject), boundSql);
  this.mappedStatement = mappedStatement;
  this.configuration = mappedStatement.getConfiguration();
  this.typeHandlerRegistry = mappedStatement.getConfiguration().getTypeHandlerRegistry();
  this.parameterObject = parameterObject;
  this.boundSql = boundSql;
}

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

boolean hasTypeHandler = ms.getConfiguration().getTypeHandlerRegistry().hasTypeHandler(parameterObject.getClass());
MetaObject metaObject = MetaObjectUtil.forObject(parameterObject);

代码示例来源:origin: wuyouzhuguli/FEBS-Shiro

TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
if (typeHandlerRegistry.hasTypeHandler(parameterObject.getClass())) {
  sql = sql.replaceFirst("\\?", Matcher.quoteReplacement(getParameterValue(parameterObject)));

代码示例来源:origin: hs-web/hsweb-framework

MybatisUtils.sqlSession = sqlSessionFactory;
EnumDictHandlerRegister.typeHandlerRegistry = sqlSessionFactory.getConfiguration().getTypeHandlerRegistry();
EnumDictHandlerRegister.register("org.hswebframework.web;" + mybatisProperties.getTypeHandlersPackage());

代码示例来源:origin: camunda/camunda-bpm-platform

private void resolveTypeHandler() {
 if (resultMapping.typeHandler == null && resultMapping.javaType != null) {
  Configuration configuration = resultMapping.configuration;
  TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
  resultMapping.typeHandler = typeHandlerRegistry.getTypeHandler(resultMapping.javaType, resultMapping.jdbcType);
 }
}

代码示例来源:origin: org.mybatis/mybatis

public BaseBuilder(Configuration configuration) {
 this.configuration = configuration;
 this.typeAliasRegistry = this.configuration.getTypeAliasRegistry();
 this.typeHandlerRegistry = this.configuration.getTypeHandlerRegistry();
}

代码示例来源:origin: camunda/camunda-bpm-platform

private void resolveTypeHandler() {
 if (parameterMapping.typeHandler == null && parameterMapping.javaType != null) {
  Configuration configuration = parameterMapping.configuration;
  TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
  parameterMapping.typeHandler = typeHandlerRegistry.getTypeHandler(parameterMapping.javaType, parameterMapping.jdbcType);
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

public BaseBuilder(Configuration configuration) {
 this.configuration = configuration;
 this.typeAliasRegistry = this.configuration.getTypeAliasRegistry();
 this.typeHandlerRegistry = this.configuration.getTypeHandlerRegistry();
}

代码示例来源:origin: org.mybatis/mybatis

private void resolveTypeHandler() {
 if (resultMapping.typeHandler == null && resultMapping.javaType != null) {
  Configuration configuration = resultMapping.configuration;
  TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
  resultMapping.typeHandler = typeHandlerRegistry.getTypeHandler(resultMapping.javaType, resultMapping.jdbcType);
 }
}

代码示例来源:origin: org.mybatis/mybatis

/**
 * Set a default {@link TypeHandler} class for {@link Enum}.
 * A default {@link TypeHandler} is {@link org.apache.ibatis.type.EnumTypeHandler}.
 * @param typeHandler a type handler class for {@link Enum}
 * @since 3.4.5
 */
public void setDefaultEnumTypeHandler(Class<? extends TypeHandler> typeHandler) {
 if (typeHandler != null) {
  getTypeHandlerRegistry().setDefaultEnumTypeHandler(typeHandler);
 }
}

代码示例来源:origin: org.mybatis/mybatis

private void resolveTypeHandler() {
 if (parameterMapping.typeHandler == null && parameterMapping.javaType != null) {
  Configuration configuration = parameterMapping.configuration;
  TypeHandlerRegistry typeHandlerRegistry = configuration.getTypeHandlerRegistry();
  parameterMapping.typeHandler = typeHandlerRegistry.getTypeHandler(parameterMapping.javaType, parameterMapping.jdbcType);
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

public ResultSetWrapper(ResultSet rs, Configuration configuration) throws SQLException {
 super();
 this.typeHandlerRegistry = configuration.getTypeHandlerRegistry();
 this.resultSet = rs;
 final ResultSetMetaData metaData = rs.getMetaData();
 final int columnCount = metaData.getColumnCount();
 for (int i = 1; i <= columnCount; i++) {
  columnNames.add(configuration.isUseColumnLabel() ? metaData.getColumnLabel(i) : metaData.getColumnName(i));
  jdbcTypes.add(JdbcType.forCode(metaData.getColumnType(i)));
  classNames.add(metaData.getColumnClassName(i));
 }
}

代码示例来源:origin: org.mybatis/mybatis

public ResultSetWrapper(ResultSet rs, Configuration configuration) throws SQLException {
 super();
 this.typeHandlerRegistry = configuration.getTypeHandlerRegistry();
 this.resultSet = rs;
 final ResultSetMetaData metaData = rs.getMetaData();
 final int columnCount = metaData.getColumnCount();
 for (int i = 1; i <= columnCount; i++) {
  columnNames.add(configuration.isUseColumnLabel() ? metaData.getColumnLabel(i) : metaData.getColumnName(i));
  jdbcTypes.add(JdbcType.forCode(metaData.getColumnType(i)));
  classNames.add(metaData.getColumnClassName(i));
 }
}

代码示例来源:origin: camunda/camunda-bpm-platform

private List<ResultMapping> parseCompositeColumnName(String columnName) {
 List<ResultMapping> composites = new ArrayList<ResultMapping>();
 if (columnName != null && (columnName.indexOf('=') > -1 || columnName.indexOf(',') > -1)) {
  StringTokenizer parser = new StringTokenizer(columnName, "{}=, ", false);
  while (parser.hasMoreTokens()) {
   String property = parser.nextToken();
   String column = parser.nextToken();
   ResultMapping complexResultMapping = new ResultMapping.Builder(
     configuration, property, column, configuration.getTypeHandlerRegistry().getUnknownTypeHandler()).build();
   composites.add(complexResultMapping);
  }
 }
 return composites;
}

代码示例来源:origin: camunda/camunda-bpm-platform

public DefaultParameterHandler(MappedStatement mappedStatement, Object parameterObject, BoundSql boundSql) {
 this.mappedStatement = mappedStatement;
 this.configuration = mappedStatement.getConfiguration();
 this.typeHandlerRegistry = mappedStatement.getConfiguration().getTypeHandlerRegistry();
 this.parameterObject = parameterObject;
 this.boundSql = boundSql;
}

代码示例来源:origin: org.mybatis/mybatis

public DefaultParameterHandler(MappedStatement mappedStatement, Object parameterObject, BoundSql boundSql) {
 this.mappedStatement = mappedStatement;
 this.configuration = mappedStatement.getConfiguration();
 this.typeHandlerRegistry = mappedStatement.getConfiguration().getTypeHandlerRegistry();
 this.parameterObject = parameterObject;
 this.boundSql = boundSql;
}

代码示例来源:origin: org.mybatis/mybatis

public DefaultResultSetHandler(Executor executor, MappedStatement mappedStatement, ParameterHandler parameterHandler, ResultHandler<?> resultHandler, BoundSql boundSql,
                RowBounds rowBounds) {
 this.executor = executor;
 this.configuration = mappedStatement.getConfiguration();
 this.mappedStatement = mappedStatement;
 this.rowBounds = rowBounds;
 this.parameterHandler = parameterHandler;
 this.boundSql = boundSql;
 this.typeHandlerRegistry = configuration.getTypeHandlerRegistry();
 this.objectFactory = configuration.getObjectFactory();
 this.reflectorFactory = configuration.getReflectorFactory();
 this.resultHandler = resultHandler;
}

代码示例来源:origin: camunda/camunda-bpm-platform

public DefaultResultSetHandler(Executor executor, MappedStatement mappedStatement, ParameterHandler parameterHandler, ResultHandler<?> resultHandler, BoundSql boundSql,
                RowBounds rowBounds) {
 this.executor = executor;
 this.configuration = mappedStatement.getConfiguration();
 this.mappedStatement = mappedStatement;
 this.rowBounds = rowBounds;
 this.parameterHandler = parameterHandler;
 this.boundSql = boundSql;
 this.typeHandlerRegistry = configuration.getTypeHandlerRegistry();
 this.objectFactory = configuration.getObjectFactory();
 this.reflectorFactory = configuration.getReflectorFactory();
 this.resultHandler = resultHandler;
 this.primitiveTypes = new PrimitiveTypes();
}

代码示例来源:origin: camunda/camunda-bpm-platform

protected BaseStatementHandler(Executor executor, MappedStatement mappedStatement, Object parameterObject, RowBounds rowBounds, ResultHandler resultHandler, BoundSql boundSql) {
 this.configuration = mappedStatement.getConfiguration();
 this.executor = executor;
 this.mappedStatement = mappedStatement;
 this.rowBounds = rowBounds;
 this.typeHandlerRegistry = configuration.getTypeHandlerRegistry();
 this.objectFactory = configuration.getObjectFactory();
 if (boundSql == null) { // issue #435, get the key before calculating the statement
  generateKeys(parameterObject);
  boundSql = mappedStatement.getBoundSql(parameterObject);
 }
 this.boundSql = boundSql;
 this.parameterHandler = configuration.newParameterHandler(mappedStatement, parameterObject, boundSql);
 this.resultSetHandler = configuration.newResultSetHandler(executor, mappedStatement, rowBounds, parameterHandler, resultHandler, boundSql);
}

相关文章

Configuration类方法