35
35
import org .springframework .jdbc .support .nativejdbc .NativeJdbcExtractor ;
36
36
37
37
/**
38
- * Class to manage context metadata used for the configuration
38
+ * Class to manage context meta-data used for the configuration
39
39
* and execution of operations on a database table.
40
40
*
41
41
* @author Thomas Risberg
@@ -59,13 +59,13 @@ public class TableMetaDataContext {
59
59
// List of columns objects to be used in this context
60
60
private List <String > tableColumns = new ArrayList <String >();
61
61
62
- // Should we access insert parameter meta data info or not
62
+ // Should we access insert parameter meta- data info or not
63
63
private boolean accessTableColumnMetaData = true ;
64
64
65
- // Should we override default for including synonyms for meta data lookups
65
+ // Should we override default for including synonyms for meta- data lookups
66
66
private boolean overrideIncludeSynonymsDefault = false ;
67
67
68
- // The provider of table meta data
68
+ // The provider of table meta- data
69
69
private TableMetaDataProvider metaDataProvider ;
70
70
71
71
// Are we using generated key columns
@@ -118,14 +118,14 @@ public String getSchemaName() {
118
118
}
119
119
120
120
/**
121
- * Specify whether we should access table column meta data.
121
+ * Specify whether we should access table column meta- data.
122
122
*/
123
123
public void setAccessTableColumnMetaData (boolean accessTableColumnMetaData ) {
124
124
this .accessTableColumnMetaData = accessTableColumnMetaData ;
125
125
}
126
126
127
127
/**
128
- * Are we accessing table meta data?
128
+ * Are we accessing table meta- data?
129
129
*/
130
130
public boolean isAccessTableColumnMetaData () {
131
131
return this .accessTableColumnMetaData ;
@@ -162,7 +162,7 @@ public void setNativeJdbcExtractor(NativeJdbcExtractor nativeJdbcExtractor) {
162
162
163
163
164
164
/**
165
- * Process the current meta data with the provided configuration options.
165
+ * Process the current meta- data with the provided configuration options.
166
166
* @param dataSource the DataSource being used
167
167
* @param declaredColumns any columns that are declared
168
168
* @param generatedKeyNames name of generated keys
@@ -174,7 +174,7 @@ public void processMetaData(DataSource dataSource, List<String> declaredColumns,
174
174
}
175
175
176
176
/**
177
- * Compare columns created from metadata with declared columns and return a reconciled list.
177
+ * Compare columns created from meta-data with declared columns and return a reconciled list.
178
178
* @param declaredColumns declared column names
179
179
* @param generatedKeyNames names of generated key columns
180
180
*/
@@ -205,7 +205,7 @@ protected List<String> reconcileColumnsToUse(List<String> declaredColumns, Strin
205
205
public List <Object > matchInParameterValuesWithInsertColumns (SqlParameterSource parameterSource ) {
206
206
List <Object > values = new ArrayList <Object >();
207
207
// For parameter source lookups we need to provide case-insensitive lookup support since the
208
- // database metadata is not necessarily providing case-sensitive column names
208
+ // database meta-data is not necessarily providing case-sensitive column names
209
209
Map <String , String > caseInsensitiveParameterNames =
210
210
SqlParameterSourceUtils .extractCaseInsensitiveParameterNames (parameterSource );
211
211
for (String column : this .tableColumns ) {
@@ -255,7 +255,7 @@ public List<Object> matchInParameterValuesWithInsertColumns(Map<String, ?> inPar
255
255
256
256
257
257
/**
258
- * Build the insert string based on configuration and metadata information
258
+ * Build the insert string based on configuration and meta-data information
259
259
* @return the insert string to be used
260
260
*/
261
261
public String createInsertString (String ... generatedKeyNames ) {
@@ -303,7 +303,7 @@ public String createInsertString(String... generatedKeyNames) {
303
303
}
304
304
305
305
/**
306
- * Build the array of {@link java.sql.Types} based on configuration and metadata information
306
+ * Build the array of {@link java.sql.Types} based on configuration and meta-data information.
307
307
* @return the array of types to be used
308
308
*/
309
309
public int [] createInsertTypes () {
@@ -335,7 +335,7 @@ public int[] createInsertTypes() {
335
335
336
336
337
337
/**
338
- * Does this database support the JDBC 3.0 feature of retrieving generated keys
338
+ * Does this database support the JDBC 3.0 feature of retrieving generated keys:
339
339
* {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}?
340
340
*/
341
341
public boolean isGetGeneratedKeysSupported () {
@@ -344,19 +344,27 @@ public boolean isGetGeneratedKeysSupported() {
344
344
345
345
/**
346
346
* Does this database support simple query to retrieve generated keys
347
- * when the JDBC 3.0 feature is not supported.
347
+ * when the JDBC 3.0 feature is not supported:
348
348
* {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}?
349
349
*/
350
350
public boolean isGetGeneratedKeysSimulated () {
351
351
return this .metaDataProvider .isGetGeneratedKeysSimulated ();
352
352
}
353
353
354
354
/**
355
- * Does this database support simple query to retrieve generated keys
356
- * when the JDBC 3.0 feature is not supported.
357
- * {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}?
355
+ * @deprecated as of 4.3.15, in favor of {@link #getSimpleQueryForGetGeneratedKey}
358
356
*/
357
+ @ Deprecated
359
358
public String getSimulationQueryForGetGeneratedKey (String tableName , String keyColumnName ) {
359
+ return getSimpleQueryForGetGeneratedKey (tableName , keyColumnName );
360
+ }
361
+
362
+ /**
363
+ * Does this database support a simple query to retrieve generated keys
364
+ * when the JDBC 3.0 feature is not supported:
365
+ * {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}?
366
+ */
367
+ public String getSimpleQueryForGetGeneratedKey (String tableName , String keyColumnName ) {
360
368
return this .metaDataProvider .getSimpleQueryForGetGeneratedKey (tableName , keyColumnName );
361
369
}
362
370
0 commit comments