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

项目:summerb    文件:TableMetaDataContext.java   
/**
 * Compare columns created from metadata with declared columns and return a
 * reconciled list.
 * 
 * @param declaredColumns
 *            declared column names
 * @param generatedKeyNames
 *            names of generated key columns
 */
protected List<String> reconcileColumnsToUse(List<String> declaredColumns, String[] generatedKeyNames) {
    if (declaredColumns.size() > 0) {
        return new ArrayList<String>(declaredColumns);
    }
    Set<String> keys = new HashSet<String>(generatedKeyNames.length);
    for (String key : generatedKeyNames) {
        keys.add(key.toUpperCase());
    }
    List<String> columns = new ArrayList<String>();
    for (TableParameterMetaData meta : metaDataProvider.getTableParameterMetaData()) {
        if (!keys.contains(meta.getParameterName().toUpperCase())) {
            columns.add(meta.getParameterName());
        }
    }
    return columns;
}
项目:pluggable    文件:TableMetaDataContext.java   
/**
 * Compare columns created from metadata with declared columns and return a
 * reconciled list.
 * 
 * @param declaredColumns
 *            declared column names
 * @param generatedKeyNames
 *            names of generated key columns
 */
protected List<String> reconcileColumnsToUse(List<String> declaredColumns,
        String[] generatedKeyNames) {
    if (declaredColumns.size() > 0) {
        return new ArrayList<String>(declaredColumns);
    }
    Set<String> keys = new HashSet<String>(generatedKeyNames.length);
    for (String key : generatedKeyNames) {
        keys.add(key.toUpperCase());
    }
    List<String> columns = new ArrayList<String>();
    for (TableParameterMetaData meta : metaDataProvider
            .getTableParameterMetaData()) {
        if (!keys.contains(meta.getParameterName().toUpperCase())) {
            columns.add(meta.getParameterName());
        }
    }
    return columns;
}
项目: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   
public List<String> createColumns() {
    List<TableParameterMetaData> tableParameterMetaDataList = this.metaDataProvider.getTableParameterMetaData();
    List<String> columnList = new ArrayList<String>(tableParameterMetaDataList.size());
    for (TableParameterMetaData tableParameterMetaData : tableParameterMetaDataList) {
        columnList.add(tableParameterMetaData.getParameterName());
    }
    return columnList;
}
项目:pluggable    文件:TableMetaDataContext.java   
public List<String> createColumns() {
    List<TableParameterMetaData> tableParameterMetaDataList = this.metaDataProvider
            .getTableParameterMetaData();
    List<String> columnList = new ArrayList<String>(
            tableParameterMetaDataList.size());
    for (TableParameterMetaData tableParameterMetaData : tableParameterMetaDataList) {
        columnList.add(tableParameterMetaData.getParameterName());
    }
    return columnList;
}