Example usage for org.apache.ibatis.session Configuration getMappedStatement

List of usage examples for org.apache.ibatis.session Configuration getMappedStatement

Introduction

In this page you can find the example usage for org.apache.ibatis.session Configuration getMappedStatement.

Prototype

public MappedStatement getMappedStatement(String id, boolean validateIncompleteStatements) 

Source Link

Usage

From source file:cn.org.awcp.core.mybatis.mapper.MapperTemplate.java

License:Open Source License

/**
 * SelectKey - ?mysqlOracle?/*w  w  w . ja  v a 2s. c  o  m*/
 * 
 * @param ms
 * @param column
 */
protected void newSelectKeyMappedStatement(MappedStatement ms, EntityHelper.EntityColumn column) {
    String keyId = ms.getId() + SelectKeyGenerator.SELECT_KEY_SUFFIX;
    if (ms.getConfiguration().hasKeyGenerator(keyId)) {
        return;
    }
    Class<?> entityClass = getSelectReturnType(ms);
    // defaults
    Configuration configuration = ms.getConfiguration();
    KeyGenerator keyGenerator = null;
    Boolean executeBefore = getBEFORE();
    String IDENTITY = (column.getGenerator() == null || column.getGenerator().equals("")) ? getIDENTITY()
            : column.getGenerator();
    if (IDENTITY.equalsIgnoreCase("JDBC")) {
        keyGenerator = new Jdbc3KeyGenerator();
    } else {
        SqlSource sqlSource = new RawSqlSource(configuration, IDENTITY, entityClass);

        MappedStatement.Builder statementBuilder = new MappedStatement.Builder(configuration, keyId, sqlSource,
                SqlCommandType.SELECT);
        statementBuilder.resource(ms.getResource());
        statementBuilder.fetchSize(null);
        statementBuilder.statementType(StatementType.STATEMENT);
        statementBuilder.keyGenerator(new NoKeyGenerator());
        statementBuilder.keyProperty(column.getProperty());
        statementBuilder.keyColumn(null);
        statementBuilder.databaseId(null);
        statementBuilder.lang(configuration.getDefaultScriptingLanuageInstance());
        statementBuilder.resultOrdered(false);
        statementBuilder.resulSets(null);
        statementBuilder.timeout(configuration.getDefaultStatementTimeout());

        List<ParameterMapping> parameterMappings = new ArrayList<ParameterMapping>();
        ParameterMap.Builder inlineParameterMapBuilder = new ParameterMap.Builder(configuration,
                statementBuilder.id() + "-Inline", entityClass, parameterMappings);
        statementBuilder.parameterMap(inlineParameterMapBuilder.build());

        List<ResultMap> resultMaps = new ArrayList<ResultMap>();
        ResultMap.Builder inlineResultMapBuilder = new ResultMap.Builder(configuration,
                statementBuilder.id() + "-Inline", column.getJavaType(), new ArrayList<ResultMapping>(), null);
        resultMaps.add(inlineResultMapBuilder.build());
        statementBuilder.resultMaps(resultMaps);
        statementBuilder.resultSetType(null);

        statementBuilder.flushCacheRequired(false);
        statementBuilder.useCache(false);
        statementBuilder.cache(null);

        MappedStatement statement = statementBuilder.build();
        configuration.addMappedStatement(statement);

        MappedStatement keyStatement = configuration.getMappedStatement(keyId, false);
        keyGenerator = new SelectKeyGenerator(keyStatement, executeBefore);
        configuration.addKeyGenerator(keyId, keyGenerator);
    }
    // keyGenerator
    try {
        MetaObject msObject = forObject(ms);
        msObject.setValue("keyGenerator", keyGenerator);
        msObject.setValue("keyProperties", new String[] { column.getProperty() });
    } catch (Exception e) {
        // ignore
    }
}

From source file:com.github.abel533.mapper.MapperTemplate.java

License:Open Source License

/**
 * SelectKey - ?mysqlOracle?/* ww w . ja  v a  2 s . c o  m*/
 *
 * @param ms
 * @param column
 */
protected void newSelectKeyMappedStatement(MappedStatement ms, EntityHelper.EntityColumn column) {
    String keyId = ms.getId() + SelectKeyGenerator.SELECT_KEY_SUFFIX;
    if (ms.getConfiguration().hasKeyGenerator(keyId)) {
        return;
    }
    Class<?> entityClass = getSelectReturnType(ms);
    //defaults
    Configuration configuration = ms.getConfiguration();
    KeyGenerator keyGenerator = new NoKeyGenerator();
    Boolean executeBefore = getBEFORE();
    String IDENTITY = (column.getGenerator() == null || column.getGenerator().equals("")) ? getIDENTITY()
            : column.getGenerator();
    SqlSource sqlSource = new RawSqlSource(configuration, IDENTITY, entityClass);

    MappedStatement.Builder statementBuilder = new MappedStatement.Builder(configuration, keyId, sqlSource,
            SqlCommandType.SELECT);
    statementBuilder.resource(ms.getResource());
    statementBuilder.fetchSize(null);
    statementBuilder.statementType(StatementType.STATEMENT);
    statementBuilder.keyGenerator(keyGenerator);
    statementBuilder.keyProperty(column.getProperty());
    statementBuilder.keyColumn(null);
    statementBuilder.databaseId(null);
    statementBuilder.lang(configuration.getDefaultScriptingLanuageInstance());
    statementBuilder.resultOrdered(false);
    statementBuilder.resulSets(null);
    statementBuilder.timeout(configuration.getDefaultStatementTimeout());

    List<ParameterMapping> parameterMappings = new ArrayList<ParameterMapping>();
    ParameterMap.Builder inlineParameterMapBuilder = new ParameterMap.Builder(configuration,
            statementBuilder.id() + "-Inline", entityClass, parameterMappings);
    statementBuilder.parameterMap(inlineParameterMapBuilder.build());

    List<ResultMap> resultMaps = new ArrayList<ResultMap>();
    ResultMap.Builder inlineResultMapBuilder = new ResultMap.Builder(configuration,
            statementBuilder.id() + "-Inline", int.class, new ArrayList<ResultMapping>(), null);
    resultMaps.add(inlineResultMapBuilder.build());
    statementBuilder.resultMaps(resultMaps);
    statementBuilder.resultSetType(null);

    statementBuilder.flushCacheRequired(false);
    statementBuilder.useCache(false);
    statementBuilder.cache(null);

    MappedStatement statement = statementBuilder.build();
    configuration.addMappedStatement(statement);

    MappedStatement keyStatement = configuration.getMappedStatement(keyId, false);
    configuration.addKeyGenerator(keyId, new SelectKeyGenerator(keyStatement, executeBefore));
    //keyGenerator
    try {
        MetaObject msObject = forObject(ms);
        msObject.setValue("keyGenerator", configuration.getKeyGenerator(keyId));
    } catch (Exception e) {
        //ignore
    }
}

From source file:com.github.abel533.mapperhelper.MapperTemplate.java

License:Open Source License

/**
 * SelectKey - ?mysqlOracle?//from w  w  w. ja  v  a2s.  c  o m
 *
 * @param ms
 * @param column
 */
protected void newSelectKeyMappedStatement(MappedStatement ms, EntityHelper.EntityColumn column) {
    String keyId = ms.getId() + SelectKeyGenerator.SELECT_KEY_SUFFIX;
    if (ms.getConfiguration().hasKeyGenerator(keyId)) {
        return;
    }
    Class<?> entityClass = getSelectReturnType(ms);
    //defaults
    Configuration configuration = ms.getConfiguration();
    KeyGenerator keyGenerator = null;
    Boolean executeBefore = getBEFORE();
    String IDENTITY = (column.getGenerator() == null || column.getGenerator().equals("")) ? getIDENTITY()
            : column.getGenerator();
    if (IDENTITY.equalsIgnoreCase("JDBC")) {
        keyGenerator = new Jdbc3KeyGenerator();
    } else {
        SqlSource sqlSource = new RawSqlSource(configuration, IDENTITY, entityClass);

        MappedStatement.Builder statementBuilder = new MappedStatement.Builder(configuration, keyId, sqlSource,
                SqlCommandType.SELECT);
        statementBuilder.resource(ms.getResource());
        statementBuilder.fetchSize(null);
        statementBuilder.statementType(StatementType.STATEMENT);
        statementBuilder.keyGenerator(new NoKeyGenerator());
        statementBuilder.keyProperty(column.getProperty());
        statementBuilder.keyColumn(null);
        statementBuilder.databaseId(null);
        statementBuilder.lang(configuration.getDefaultScriptingLanuageInstance());
        statementBuilder.resultOrdered(false);
        statementBuilder.resulSets(null);
        statementBuilder.timeout(configuration.getDefaultStatementTimeout());

        List<ParameterMapping> parameterMappings = new ArrayList<ParameterMapping>();
        ParameterMap.Builder inlineParameterMapBuilder = new ParameterMap.Builder(configuration,
                statementBuilder.id() + "-Inline", entityClass, parameterMappings);
        statementBuilder.parameterMap(inlineParameterMapBuilder.build());

        List<ResultMap> resultMaps = new ArrayList<ResultMap>();
        ResultMap.Builder inlineResultMapBuilder = new ResultMap.Builder(configuration,
                statementBuilder.id() + "-Inline", column.getJavaType(), new ArrayList<ResultMapping>(), null);
        resultMaps.add(inlineResultMapBuilder.build());
        statementBuilder.resultMaps(resultMaps);
        statementBuilder.resultSetType(null);

        statementBuilder.flushCacheRequired(false);
        statementBuilder.useCache(false);
        statementBuilder.cache(null);

        MappedStatement statement = statementBuilder.build();
        configuration.addMappedStatement(statement);

        MappedStatement keyStatement = configuration.getMappedStatement(keyId, false);
        keyGenerator = new SelectKeyGenerator(keyStatement, executeBefore);
        configuration.addKeyGenerator(keyId, keyGenerator);
    }
    //keyGenerator
    try {
        MetaObject msObject = forObject(ms);
        msObject.setValue("keyGenerator", keyGenerator);
        msObject.setValue("keyProperties", new String[] { column.getProperty() });
    } catch (Exception e) {
        //ignore
    }
}

From source file:com.github.pagehelper.util.ExecutorUtil.java

License:Open Source License

/**
 * ??? MS??countpage?//ww w .  jav a  2s.co m
 *
 * @param configuration
 * @param msId
 * @return
 */
public static MappedStatement getExistedMappedStatement(Configuration configuration, String msId) {
    MappedStatement mappedStatement = null;
    try {
        mappedStatement = configuration.getMappedStatement(msId, false);
    } catch (Throwable t) {
        //ignore
    }
    return mappedStatement;
}

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

License:Open Source License

/**
 * SelectKey//  www .  j a va2 s.c  o  m
 *
 * @param ms
 * @param column
 */
protected void newSelectKeyMappedStatement(MappedStatement ms, EntityColumn column) {
    String keyId = ms.getId() + SelectKeyGenerator.SELECT_KEY_SUFFIX;
    if (ms.getConfiguration().hasKeyGenerator(keyId)) {
        return;
    }
    Class<?> entityClass = getEntityClass(ms);
    //defaults
    Configuration configuration = ms.getConfiguration();
    KeyGenerator keyGenerator;
    Boolean executeBefore = isBEFORE();
    // mod by jessen
    String generator = column.getGenerator() == null ? null : column.getGenerator();
    String IDENTITY = ("IDENTITY".equals(generator) || StringUtil.isEmpty(generator)) ? getIDENTITY()
            : generator;
    if (IDENTITY.equalsIgnoreCase("JDBC")) {
        keyGenerator = new Jdbc3KeyGenerator();
    } else {
        if ("SEQUENCE".equalsIgnoreCase(IDENTITY)) {
            // add by jessen, sql for selectKey
            IDENTITY = "SELECT " + getSeqNextVal(column) + " FROM DUAL";
        }
        SqlSource sqlSource = new RawSqlSource(configuration, IDENTITY, entityClass);

        MappedStatement.Builder statementBuilder = new MappedStatement.Builder(configuration, keyId, sqlSource,
                SqlCommandType.SELECT);
        statementBuilder.resource(ms.getResource());
        statementBuilder.fetchSize(null);
        statementBuilder.statementType(StatementType.STATEMENT);
        statementBuilder.keyGenerator(new NoKeyGenerator());
        statementBuilder.keyProperty(column.getProperty());
        statementBuilder.keyColumn(null);
        statementBuilder.databaseId(null);
        statementBuilder.lang(configuration.getDefaultScriptingLanuageInstance());
        statementBuilder.resultOrdered(false);
        statementBuilder.resulSets(null);
        statementBuilder.timeout(configuration.getDefaultStatementTimeout());

        List<ParameterMapping> parameterMappings = new ArrayList<ParameterMapping>();
        ParameterMap.Builder inlineParameterMapBuilder = new ParameterMap.Builder(configuration,
                statementBuilder.id() + "-Inline", entityClass, parameterMappings);
        statementBuilder.parameterMap(inlineParameterMapBuilder.build());

        List<ResultMap> resultMaps = new ArrayList<ResultMap>();
        ResultMap.Builder inlineResultMapBuilder = new ResultMap.Builder(configuration,
                statementBuilder.id() + "-Inline", column.getJavaType(), new ArrayList<ResultMapping>(), null);
        resultMaps.add(inlineResultMapBuilder.build());
        statementBuilder.resultMaps(resultMaps);
        statementBuilder.resultSetType(null);

        statementBuilder.flushCacheRequired(false);
        statementBuilder.useCache(false);
        statementBuilder.cache(null);

        MappedStatement statement = statementBuilder.build();
        try {
            configuration.addMappedStatement(statement);
        } catch (Exception e) {
            //ignore
        }
        MappedStatement keyStatement = configuration.getMappedStatement(keyId, false);
        keyGenerator = new SelectKeyGenerator(keyStatement, executeBefore);
        try {
            configuration.addKeyGenerator(keyId, keyGenerator);
        } catch (Exception e) {
            //ignore
        }
    }
    //keyGenerator
    try {
        MetaObject msObject = SystemMetaObject.forObject(ms);
        msObject.setValue("keyGenerator", keyGenerator);
        msObject.setValue("keyProperties", column.getTable().getKeyProperties());
        msObject.setValue("keyColumns", column.getTable().getKeyColumns());
    } catch (Exception e) {
        //ignore
    }
}

From source file:com.noasking.mapper.mapperhelper.MapperTemplate.java

License:Open Source License

/**
 * SelectKey//w w  w  .j  a  va2  s  . c o  m
 *
 * @param ms
 * @param column
 */
protected void newSelectKeyMappedStatement(MappedStatement ms, EntityColumn column) {
    String keyId = ms.getId() + SelectKeyGenerator.SELECT_KEY_SUFFIX;
    if (ms.getConfiguration().hasKeyGenerator(keyId)) {
        return;
    }
    Class<?> entityClass = getEntityClass(ms);
    //defaults
    Configuration configuration = ms.getConfiguration();
    KeyGenerator keyGenerator;
    Boolean executeBefore = isBEFORE();
    String IDENTITY = (column.getGenerator() == null || column.getGenerator().equals("")) ? getIDENTITY()
            : column.getGenerator();
    if (IDENTITY.equalsIgnoreCase("JDBC")) {
        keyGenerator = new Jdbc3KeyGenerator();
    } else {
        SqlSource sqlSource = new RawSqlSource(configuration, IDENTITY, entityClass);

        MappedStatement.Builder statementBuilder = new MappedStatement.Builder(configuration, keyId, sqlSource,
                SqlCommandType.SELECT);
        statementBuilder.resource(ms.getResource());
        statementBuilder.fetchSize(null);
        statementBuilder.statementType(StatementType.STATEMENT);
        statementBuilder.keyGenerator(new NoKeyGenerator());
        statementBuilder.keyProperty(column.getProperty());
        statementBuilder.keyColumn(null);
        statementBuilder.databaseId(null);
        statementBuilder.lang(configuration.getDefaultScriptingLanuageInstance());
        statementBuilder.resultOrdered(false);
        statementBuilder.resulSets(null);
        statementBuilder.timeout(configuration.getDefaultStatementTimeout());

        List<ParameterMapping> parameterMappings = new ArrayList<ParameterMapping>();
        ParameterMap.Builder inlineParameterMapBuilder = new ParameterMap.Builder(configuration,
                statementBuilder.id() + "-Inline", entityClass, parameterMappings);
        statementBuilder.parameterMap(inlineParameterMapBuilder.build());

        List<ResultMap> resultMaps = new ArrayList<ResultMap>();
        ResultMap.Builder inlineResultMapBuilder = new ResultMap.Builder(configuration,
                statementBuilder.id() + "-Inline", column.getJavaType(), new ArrayList<ResultMapping>(), null);
        resultMaps.add(inlineResultMapBuilder.build());
        statementBuilder.resultMaps(resultMaps);
        statementBuilder.resultSetType(null);

        statementBuilder.flushCacheRequired(false);
        statementBuilder.useCache(false);
        statementBuilder.cache(null);

        MappedStatement statement = statementBuilder.build();
        try {
            configuration.addMappedStatement(statement);
        } catch (Exception e) {
            //ignore
        }
        MappedStatement keyStatement = configuration.getMappedStatement(keyId, false);
        keyGenerator = new SelectKeyGenerator(keyStatement, executeBefore);
        try {
            configuration.addKeyGenerator(keyId, keyGenerator);
        } catch (Exception e) {
            //ignore
        }
    }
    //keyGenerator
    try {
        MetaObject msObject = SystemMetaObject.forObject(ms);
        msObject.setValue("keyGenerator", keyGenerator);
        msObject.setValue("keyProperties", column.getTable().getKeyProperties());
        msObject.setValue("keyColumns", column.getTable().getKeyColumns());
    } catch (Exception e) {
        //ignore
    }
}

From source file:com.sinotopia.mybatis.mapper.mapperhelper.MapperTemplate.java

License:Open Source License

/**
 * SelectKey/*  w  ww . j  a  va2 s.  c  o m*/
 *
 * @param ms
 * @param column
 */
protected void newSelectKeyMappedStatement(MappedStatement ms, EntityColumn column) {
    String keyId = ms.getId() + SelectKeyGenerator.SELECT_KEY_SUFFIX;
    if (ms.getConfiguration().hasKeyGenerator(keyId)) {
        return;
    }
    Class<?> entityClass = getEntityClass(ms);
    //defaults
    Configuration configuration = ms.getConfiguration();
    KeyGenerator keyGenerator;
    Boolean executeBefore = isBEFORE();
    String IDENTITY = (column.getGenerator() == null || column.getGenerator().equals("")) ? getIDENTITY(column)
            : column.getGenerator();
    if (IDENTITY.equalsIgnoreCase("JDBC")) {
        keyGenerator = new Jdbc3KeyGenerator();
    } else {
        SqlSource sqlSource = new RawSqlSource(configuration, IDENTITY, entityClass);

        MappedStatement.Builder statementBuilder = new MappedStatement.Builder(configuration, keyId, sqlSource,
                SqlCommandType.SELECT);
        statementBuilder.resource(ms.getResource());
        statementBuilder.fetchSize(null);
        statementBuilder.statementType(StatementType.STATEMENT);
        statementBuilder.keyGenerator(new NoKeyGenerator());
        statementBuilder.keyProperty(column.getProperty());
        statementBuilder.keyColumn(null);
        statementBuilder.databaseId(null);
        statementBuilder.lang(configuration.getDefaultScriptingLanuageInstance());
        statementBuilder.resultOrdered(false);
        statementBuilder.resulSets(null);
        statementBuilder.timeout(configuration.getDefaultStatementTimeout());

        List<ParameterMapping> parameterMappings = new ArrayList<ParameterMapping>();
        ParameterMap.Builder inlineParameterMapBuilder = new ParameterMap.Builder(configuration,
                statementBuilder.id() + "-Inline", entityClass, parameterMappings);
        statementBuilder.parameterMap(inlineParameterMapBuilder.build());

        List<ResultMap> resultMaps = new ArrayList<ResultMap>();
        ResultMap.Builder inlineResultMapBuilder = new ResultMap.Builder(configuration,
                statementBuilder.id() + "-Inline", column.getJavaType(), new ArrayList<ResultMapping>(), null);
        resultMaps.add(inlineResultMapBuilder.build());
        statementBuilder.resultMaps(resultMaps);
        statementBuilder.resultSetType(null);

        statementBuilder.flushCacheRequired(false);
        statementBuilder.useCache(false);
        statementBuilder.cache(null);

        MappedStatement statement = statementBuilder.build();
        try {
            configuration.addMappedStatement(statement);
        } catch (Exception e) {
            //ignore
        }
        MappedStatement keyStatement = configuration.getMappedStatement(keyId, false);
        keyGenerator = new SelectKeyGenerator(keyStatement, executeBefore);
        try {
            configuration.addKeyGenerator(keyId, keyGenerator);
        } catch (Exception e) {
            //ignore
        }
    }
    //keyGenerator
    try {
        MetaObject msObject = SystemMetaObject.forObject(ms);
        msObject.setValue("keyGenerator", keyGenerator);
        msObject.setValue("keyProperties", column.getTable().getKeyProperties());
        msObject.setValue("keyColumns", column.getTable().getKeyColumns());
    } catch (Exception e) {
        //ignore
    }
}

From source file:com.sinotopia.mybatis.pagehelper.PageInterceptor.java

License:Open Source License

/**
 * ??? MS??countpage?//from www .jav a2s . c o  m
 *
 * @param configuration
 * @param msId
 * @return
 */
private MappedStatement getExistedMappedStatement(Configuration configuration, String msId) {
    MappedStatement mappedStatement = null;
    try {
        mappedStatement = configuration.getMappedStatement(msId, false);
    } catch (Throwable t) {
        //ignore
    }
    return mappedStatement;
}

From source file:message.mybatis.common.mapper.MapperTemplate.java

License:Open Source License

/**
 * SelectKey - ?mysqlOracle?/*from   www .j  a  va2 s .c o  m*/
 *
 * @param ms
 * @param column
 */
protected void newSelectKeyMappedStatement(MappedStatement ms, EntityHelper.EntityColumn column) {
    String keyId = ms.getId() + SelectKeyGenerator.SELECT_KEY_SUFFIX;
    if (ms.getConfiguration().hasKeyGenerator(keyId)) {
        return;
    }
    Class<?> entityClass = getSelectReturnType(ms);
    //defaults
    Configuration configuration = ms.getConfiguration();
    KeyGenerator keyGenerator;
    Boolean executeBefore = getBEFORE();
    String IDENTITY = (column.getGenerator() == null || column.getGenerator().equals("")) ? getIDENTITY()
            : column.getGenerator();
    if (IDENTITY.equalsIgnoreCase("JDBC")) {
        keyGenerator = new Jdbc3KeyGenerator();
    } else {
        SqlSource sqlSource = new RawSqlSource(configuration, IDENTITY, entityClass);

        MappedStatement.Builder statementBuilder = new MappedStatement.Builder(configuration, keyId, sqlSource,
                SqlCommandType.SELECT);
        statementBuilder.resource(ms.getResource());
        statementBuilder.fetchSize(null);
        statementBuilder.statementType(StatementType.STATEMENT);
        statementBuilder.keyGenerator(new NoKeyGenerator());
        statementBuilder.keyProperty(column.getProperty());
        statementBuilder.keyColumn(null);
        statementBuilder.databaseId(null);
        statementBuilder.lang(configuration.getDefaultScriptingLanuageInstance());
        statementBuilder.resultOrdered(false);
        statementBuilder.resulSets(null);
        statementBuilder.timeout(configuration.getDefaultStatementTimeout());

        List<ParameterMapping> parameterMappings = new LinkedList<ParameterMapping>();
        ParameterMap.Builder inlineParameterMapBuilder = new ParameterMap.Builder(configuration,
                statementBuilder.id() + "-Inline", entityClass, parameterMappings);
        statementBuilder.parameterMap(inlineParameterMapBuilder.build());

        List<ResultMap> resultMaps = new LinkedList<ResultMap>();
        ResultMap.Builder inlineResultMapBuilder = new ResultMap.Builder(configuration,
                statementBuilder.id() + "-Inline", column.getJavaType(), new LinkedList<ResultMapping>(), null);
        resultMaps.add(inlineResultMapBuilder.build());
        statementBuilder.resultMaps(resultMaps);
        statementBuilder.resultSetType(null);

        statementBuilder.flushCacheRequired(false);
        statementBuilder.useCache(false);
        statementBuilder.cache(null);

        MappedStatement statement = statementBuilder.build();
        try {
            configuration.addMappedStatement(statement);
        } catch (Exception e) {
            //ignore
        }
        MappedStatement keyStatement = configuration.getMappedStatement(keyId, false);
        keyGenerator = new SelectKeyGenerator(keyStatement, executeBefore);
        try {
            configuration.addKeyGenerator(keyId, keyGenerator);
        } catch (Exception e) {
            //ignore
        }
    }
    //keyGenerator
    try {
        MetaObject msObject = SystemMetaObject.forObject(ms);
        msObject.setValue("keyGenerator", keyGenerator);
        msObject.setValue("keyProperties", column.getTable().getKeyProperties());
        msObject.setValue("keyColumns", column.getTable().getKeyColumns());
    } catch (Exception e) {
        //ignore
    }
}