Package org.dbunit.database
Class DatabaseConfig
java.lang.Object
org.dbunit.database.DatabaseConfig
Configuration used by the
DatabaseConnection.- Since:
- 2.0
- Version:
- $Revision$ $Date$
- Author:
- manuel.laflamme, gommma (gommma AT users.sourceforge.net), Last changed by: $Author$
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprotected static classSets parameters stored in theDatabaseConfigon specific java objects likeStatement. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String[]Deprecated.static final DatabaseConfig.ConfigProperty[]A list of all properties asDatabaseConfig.ConfigPropertyobjects.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckObjectAllowed(String property, Object value) Checks whether the given value has the correct java type for the given property.static final DatabaseConfig.ConfigPropertyfindByName(String property) Searches theDatabaseConfig.ConfigPropertyobject for the property with the given namestatic final DatabaseConfig.ConfigPropertyfindByShortName(String propShortName) Searches theDatabaseConfig.ConfigPropertyobject for the property with the given nameprotected DatabaseConfig.ConfiguratorbooleangetFeature(String name) Deprecated.since 2.4.7 Use thegetProperty(String)where features are listed now as wellgetProperty(String name) Look up the value of a property.voidsetFeature(String name, boolean value) Deprecated.since 2.4.7 Use thesetProperty(String, Object)also for featuresvoidsetPropertiesByString(Properties stringProperties) Sets the given properties on theDatabaseConfiginstance using the given String values.voidsetProperty(String name, Object value) Set the value of a property.toString()
-
Field Details
-
PROPERTY_STATEMENT_FACTORY
- See Also:
-
PROPERTY_RESULTSET_TABLE_FACTORY
- See Also:
-
PROPERTY_DATATYPE_FACTORY
- See Also:
-
PROPERTY_ESCAPE_PATTERN
- See Also:
-
PROPERTY_TABLE_TYPE
- See Also:
-
PROPERTY_PRIMARY_KEY_FILTER
- See Also:
-
PROPERTY_BATCH_SIZE
- See Also:
-
PROPERTY_FETCH_SIZE
- See Also:
-
PROPERTY_METADATA_HANDLER
- See Also:
-
PROPERTY_ALLOW_VERIFYTABLEDEFINITION_EXPECTEDTABLE_COUNT_MISMATCH
- See Also:
-
PROPERTY_IDENTITY_COLUMN_FILTER
- See Also:
-
FEATURE_CASE_SENSITIVE_TABLE_NAMES
- See Also:
-
FEATURE_QUALIFIED_TABLE_NAMES
- See Also:
-
FEATURE_BATCHED_STATEMENTS
- See Also:
-
FEATURE_DATATYPE_WARNING
- See Also:
-
FEATURE_SKIP_ORACLE_RECYCLEBIN_TABLES
- See Also:
-
FEATURE_ALLOW_EMPTY_FIELDS
- See Also:
-
ALL_PROPERTIES
A list of all properties asDatabaseConfig.ConfigPropertyobjects. The objects contain the allowed java type and whether or not a property is nullable. -
ALL_FEATURES
Deprecated.since 2.4.7 Use theALL_PROPERTIESwhere features are listed now as wellA list of all features as strings
-
-
Constructor Details
-
DatabaseConfig
public DatabaseConfig()
-
-
Method Details
-
getConfigurator
- Returns:
- The configurator of this database config
-
setFeature
Deprecated.since 2.4.7 Use thesetProperty(String, Object)also for featuresSet the value of a feature flag.- Parameters:
name- the feature idvalue- the feature status
-
getFeature
Deprecated.since 2.4.7 Use thegetProperty(String)where features are listed now as wellLook up the value of a feature flag.- Parameters:
name- the feature id- Returns:
- the feature status
-
setProperty
Set the value of a property.- Parameters:
name- the property idvalue- the property value
-
getProperty
Look up the value of a property.- Parameters:
name- the property id- Returns:
- the property value
-
checkObjectAllowed
Checks whether the given value has the correct java type for the given property. If the value is not allowed for the given property anIllegalArgumentExceptionis thrown.- Parameters:
property- The property to be setvalue- The value to which the property should be set
-
setPropertiesByString
Sets the given properties on theDatabaseConfiginstance using the given String values. This is useful to set properties configured as strings by a build tool like ant or maven. If the required property type is an object it uses reflection to create an instance of the class specified as string.- Parameters:
stringProperties- The properties as strings. The key of the properties can be either the long or the short name.- Throws:
DatabaseUnitException
-
findByName
Searches theDatabaseConfig.ConfigPropertyobject for the property with the given name- Parameters:
property- The property for which the enumerated object should be resolved- Returns:
- The property object or
nullif it was not found.
-
findByShortName
Searches theDatabaseConfig.ConfigPropertyobject for the property with the given name- Parameters:
propShortName- The property short name for which the enumerated object should be resolved. Example: the short name of "http://www.dbunit.org/properties/fetchSize" isfetchSizewhich is the last part of the fully qualified URL.- Returns:
- The property object or
nullif it was not found.
-
toString
-
ALL_PROPERTIESwhere features are listed now as well