Package liquibase.common.datatype
Class DataTypeWrapper
java.lang.Object
liquibase.datatype.LiquibaseDataType
liquibase.common.datatype.DataTypeWrapper
- All Implemented Interfaces:
PrioritizedService
A wrapper class for data types.
Wraps a LiquibaseDataType instance and replaces some of the
original data types with dbms-compatible ones.
-
Field Summary
Fields inherited from interface liquibase.servicelocator.PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddParameter(Object value) Adds an object to the list of this data type's parameters.booleanString[]Returns one of the four basic data types for use in LoadData: BOOLEAN, NUMERIC, DATE or STRINGintgetMaxParameters(Database database) intgetMinParameters(Database database) getName()Object[]Returns an array with the parameters to the data type, e.g.intinthashCode()objectToSql(Object value, Database database) Returns the value object in a format to include in SQL.stringToObject(String value, Database database) booleantoDatabaseDataType(Database database) Transforms this data type into the native data type of the target DBMS.toString()booleanValidates the correct state of this data type against a given database.Methods inherited from class liquibase.datatype.LiquibaseDataType
finishInitialization, formatNumber, functionToSql, getAdditionalInformation, getRawDefinition, isAutoIncrement, isCurrentDateTimeFunction, numberToSql, otherToSql, setAdditionalInformation, sqlToObject
-
Constructor Details
-
DataTypeWrapper
-
-
Method Details
-
getUnderlyingDataType
-
getName
- Overrides:
getNamein classLiquibaseDataType
-
getAliases
- Overrides:
getAliasesin classLiquibaseDataType
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfacePrioritizedService- Overrides:
getPriorityin classLiquibaseDataType
-
supports
- Overrides:
supportsin classLiquibaseDataType
-
getMinParameters
- Overrides:
getMinParametersin classLiquibaseDataType
-
getMaxParameters
- Overrides:
getMaxParametersin classLiquibaseDataType
-
getParameters
Description copied from class:LiquibaseDataTypeReturns an array with the parameters to the data type, e.g. NUMBER(10, 2) would return an array with the items 10 and 2.- Overrides:
getParametersin classLiquibaseDataType- Returns:
- An array with the parameters. May contain 0 items.
-
addParameter
Description copied from class:LiquibaseDataTypeAdds an object to the list of this data type's parameters. Note that it is possible to temporarily exceed the allowed number of allowed parameters untilLiquibaseDataType.validate(Database)is called, because the number of allowed parameters might differ between DBMS.- Overrides:
addParameterin classLiquibaseDataType- Parameters:
value- the new value to add as parameter.
-
validate
Description copied from class:LiquibaseDataTypeValidates the correct state of this data type against a given database.- Overrides:
validatein classLiquibaseDataType- Parameters:
database- the database to validate against- Returns:
- true if the current settings for this data type can be implemented on the given database, false otherwise
-
toDatabaseDataType
Description copied from class:LiquibaseDataTypeTransforms this data type into the native data type of the target DBMS.- Overrides:
toDatabaseDataTypein classLiquibaseDataType- Parameters:
database- theDatabasefor which the native data type is to be constructed- Returns:
- the new, native data type
-
objectToSql
Description copied from class:LiquibaseDataTypeReturns the value object in a format to include in SQL. Quote if necessary.- Overrides:
objectToSqlin classLiquibaseDataType
-
stringToObject
-
toString
- Overrides:
toStringin classLiquibaseDataType
-
equals
- Overrides:
equalsin classLiquibaseDataType
-
hashCode
public int hashCode()- Overrides:
hashCodein classLiquibaseDataType
-
getLoadTypeName
Description copied from class:LiquibaseDataTypeReturns one of the four basic data types for use in LoadData: BOOLEAN, NUMERIC, DATE or STRING- Specified by:
getLoadTypeNamein classLiquibaseDataType- Returns:
- one of the above Strings
-