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

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

Introduction

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

Prototype

public TypeHandlerRegistry() 

Source Link

Document

The default constructor.

Usage

From source file:jp.co.ctc_g.jfw.core.jdbc.mybatis.QueryInformation.java

License:Apache License

/**
 * ??//  w ww .  j  a  va  2  s .  c  o  m
 * MyBatis?{@link StatementHandler}???????{@link InternalException}???
 * @param statementHandler {@link StatementHandler}
 */
public QueryInformation(StatementHandler statementHandler) {
    try {
        this.typeHandlerRegistry = new TypeHandlerRegistry();
        this.statementHandler = getConcreteStatementHandler(statementHandler);
        this.mappedStatement = getMappedStatement(this.statementHandler);
        this.boundSql = this.statementHandler.getBoundSql();
        this.parameterObject = this.boundSql.getParameterObject();
        this.parameterMappingList = boundSql.getParameterMappings();
        this.sqlCommandType = mappedStatement.getSqlCommandType();
        this.statementType = mappedStatement.getStatementType();
        this.metaObject = parameterObject == null ? null
                : MetaObject.forObject(parameterObject, new DefaultObjectFactory(),
                        new DefaultObjectWrapperFactory());

        switch (statementType) {
        case STATEMENT:
            this.query = boundSql.getSql();
            break;
        case PREPARED:
            this.preparedQuery = boundSql.getSql();
            break;
        case CALLABLE:
            this.callableQuery = boundSql.getSql();
            break;
        default:
            throw new InternalException(QueryInformation.class, "");
        }
    } catch (Exception e) {
        throw new InternalException(QueryInformation.class, "E-JDBC-MYBATIS#0002", e);
    }
}