/** * 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); }
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; }
/** * 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); }