Example usage for org.apache.ibatis.type TypeHandlerRegistry getTypeHandler

List of usage examples for org.apache.ibatis.type TypeHandlerRegistry getTypeHandler

Introduction

In this page you can find the example usage for org.apache.ibatis.type TypeHandlerRegistry getTypeHandler.

Prototype

public TypeHandler<?> getTypeHandler(JdbcType jdbcType) 

Source Link

Usage

From source file:com.hand.hap.mybatis.mapperhelper.MultipleJdbc3KeyGenerator.java

License:Open Source License

private TypeHandler<?>[] getTypeHandlers(TypeHandlerRegistry typeHandlerRegistry, MetaObject metaParam,
        String[] keyProperties) {
    TypeHandler<?>[] typeHandlers = new TypeHandler<?>[keyProperties.length];
    for (int i = 0; i < keyProperties.length; i++) {
        if (metaParam.hasSetter(keyProperties[i])) {
            Class<?> keyPropertyType = metaParam.getSetterType(keyProperties[i]);
            TypeHandler<?> th = typeHandlerRegistry.getTypeHandler(keyPropertyType);
            typeHandlers[i] = th;//from   w  w w.  j  ava  2  s.c  o m
        }
    }
    return typeHandlers;
}