Java 类org.springframework.jdbc.core.metadata.TableMetaDataProviderFactory 实例源码

项目:pluggable    文件:TableMetaDataContext.java   
/**
 * Process the current meta data with the provided configuration options.
 * 
 * @param dataSource
 *            the DataSource being used
 * @param declaredColumns
 *            any columns that are declared
 * @param generatedKeyNames
 *            name of generated keys
 */
public void processMetaData(DataSource dataSource) {
    // TODO: comment to explain this HORRIBLE thing!
    org.springframework.jdbc.core.metadata.TableMetaDataContext underlyingTableMetaDataContext = new org.springframework.jdbc.core.metadata.TableMetaDataContext();
    underlyingTableMetaDataContext
            .setAccessTableColumnMetaData(accessTableColumnMetaData);
    underlyingTableMetaDataContext.setCatalogName(catalogName);
    underlyingTableMetaDataContext
            .setNativeJdbcExtractor(nativeJdbcExtractor);
    underlyingTableMetaDataContext
            .setOverrideIncludeSynonymsDefault(overrideIncludeSynonymsDefault);
    underlyingTableMetaDataContext.setSchemaName(schemaName);
    underlyingTableMetaDataContext.setTableName(tableName);

    this.metaDataProvider = TableMetaDataProviderFactory
            .createMetaDataProvider(dataSource,
                    underlyingTableMetaDataContext, nativeJdbcExtractor);
}
项目:spring-data-jdbc-template    文件:SimpleJdbcUpdate.java   
private Map<String, Integer> sqlTypes() {
    TableMetaDataProvider metaDataProvider = TableMetaDataProviderFactory.createMetaDataProvider(
            jdbcTemplate.getDataSource(), tableMetaDataContext, jdbcTemplate.getNativeJdbcExtractor());

    Map<String, Integer> result = new HashMap<>();
    for (TableParameterMetaData parameterMetaData : metaDataProvider.getTableParameterMetaData()) {
        result.put(parameterMetaData.getParameterName(), parameterMetaData.getSqlType());
    }
    return result;
}
项目:summerb    文件:TableMetaDataContext.java   
/**
 * Process the current meta data with the provided configuration options.
 */
public void processMetaData(DataSource dataSource) {
    // TODO: comment to explain this HORRIBLE thing!
    org.springframework.jdbc.core.metadata.TableMetaDataContext underlyingTableMetaDataContext = new org.springframework.jdbc.core.metadata.TableMetaDataContext();
    underlyingTableMetaDataContext.setAccessTableColumnMetaData(accessTableColumnMetaData);
    underlyingTableMetaDataContext.setCatalogName(catalogName);
    underlyingTableMetaDataContext.setNativeJdbcExtractor(nativeJdbcExtractor);
    underlyingTableMetaDataContext.setOverrideIncludeSynonymsDefault(overrideIncludeSynonymsDefault);
    underlyingTableMetaDataContext.setSchemaName(schemaName);
    underlyingTableMetaDataContext.setTableName(tableName);

    this.metaDataProvider = TableMetaDataProviderFactory.createMetaDataProvider(dataSource,
            underlyingTableMetaDataContext, nativeJdbcExtractor);
}