public abstract class LiquibaseDataType extends Object implements PrioritizedService
COMPARATOR, PRIORITY_DATABASE, PRIORITY_DEFAULT
Modifier | Constructor and Description |
---|---|
|
LiquibaseDataType() |
protected |
LiquibaseDataType(LiquibaseDataType originalType) |
protected |
LiquibaseDataType(String name,
int minParameters,
int maxParameters) |
Modifier and Type | Method and Description |
---|---|
void |
addParameter(Object value)
Adds an object to the list of this data type's parameters.
|
boolean |
equals(Object o) |
void |
finishInitialization(String originalDefinition) |
protected String |
formatNumber(String value)
Removes any trailing ".0[...]0" from the end of a number
|
protected String |
functionToSql(DatabaseFunction function,
Database database) |
String |
getAdditionalInformation()
Returns additional information that was stored during
DataTypeFactory.fromDescription(String, Database)
or other parsers. |
String[] |
getAliases() |
abstract LoadDataChange.LOAD_DATA_TYPE |
getLoadTypeName()
Returns one of the four basic data types for use in LoadData: BOOLEAN, NUMERIC, DATE or STRING
|
int |
getMaxParameters(Database database) |
int |
getMinParameters(Database database) |
String |
getName() |
Object[] |
getParameters()
Returns an array with the parameters to the data type, e.g.
|
int |
getPriority() |
String |
getRawDefinition()
Obtains the "raw" data type definition if one was used to create this object as a result of parsing
|
int |
hashCode() |
boolean |
isAutoIncrement() |
protected boolean |
isCurrentDateTimeFunction(String string,
Database database)
Determines if the given function name refers to the function that returns the current
time and date for a specific DBMS.
|
protected String |
numberToSql(Number number,
Database database) |
String |
objectToSql(Object value,
Database database)
Returns the value object in a format to include in SQL.
|
protected String |
otherToSql(Object value,
Database database) |
void |
setAdditionalInformation(String additionalInformation) |
Object |
sqlToObject(String value,
Database database) |
boolean |
supports(Database database) |
DatabaseDataType |
toDatabaseDataType(Database database)
Transforms this data type into the native data type of the target DBMS.
|
String |
toString() |
boolean |
validate(Database database)
Validates the correct state of this data type against a given database.
|
protected LiquibaseDataType(LiquibaseDataType originalType)
public LiquibaseDataType()
protected LiquibaseDataType(String name, int minParameters, int maxParameters)
public String getName()
public String[] getAliases()
public int getPriority()
getPriority
in interface PrioritizedService
public boolean supports(Database database)
public int getMinParameters(Database database)
public int getMaxParameters(Database database)
public Object[] getParameters()
public void addParameter(Object value)
validate(Database)
is called, because the number of
allowed parameters might differ between DBMS.value
- the new value to add as parameter.public String getAdditionalInformation()
DataTypeFactory.fromDescription(String, Database)
or other parsers.public void setAdditionalInformation(String additionalInformation)
public String getRawDefinition()
public boolean validate(Database database)
database
- the database to validate againstpublic DatabaseDataType toDatabaseDataType(Database database)
database
- the Database
for which the native data type is to be constructedpublic String objectToSql(Object value, Database database)
protected String functionToSql(DatabaseFunction function, Database database)
protected boolean isCurrentDateTimeFunction(String string, Database database)
string
- The database function name to testdatabase
- A database object to test againstpublic void finishInitialization(String originalDefinition)
protected String formatNumber(String value)
value
- the number (in String form) to formatpublic abstract LoadDataChange.LOAD_DATA_TYPE getLoadTypeName()
public boolean isAutoIncrement()
Copyright © 2023 Liquibase.org. All rights reserved.