|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectliquibase.serializer.AbstractLiquibaseSerializable
liquibase.change.ColumnConfig
public class ColumnConfig
The standard configuration used by Change classes to represent a column. It is not required that a column-based Change uses this class, but parsers should look for it so it is a helpful convenience. The definitions of "defaultValue" and "value" will vary based on the Change and may not be applicable in all cases.
Nested Class Summary | |
---|---|
static class |
ColumnConfig.ValueNumeric
|
Nested classes/interfaces inherited from interface liquibase.serializer.LiquibaseSerializable |
---|
LiquibaseSerializable.SerializationType |
Field Summary |
---|
Fields inherited from interface liquibase.serializer.LiquibaseSerializable |
---|
GENERIC_CHANGELOG_EXTENSION_NAMESPACE, GENERIC_SNAPSHOT_EXTENSION_NAMESPACE, STANDARD_CHANGELOG_NAMESPACE, STANDARD_SNAPSHOT_NAMESPACE |
Constructor Summary | |
---|---|
ColumnConfig()
Create am empty ColumnConfig object. |
|
ColumnConfig(Column columnSnapshot)
Create a ColumnConfig object based on a Column snapshot. |
Method Summary | |
---|---|
static ColumnConfig[] |
arrayFromNames(String names)
|
static ColumnConfig |
fromName(String name)
|
Boolean |
getComputed()
|
ConstraintsConfig |
getConstraints()
Returns the ConstraintsConfig this ColumnConfig is using. |
String |
getDefaultValue()
The String default value to assign to this column. |
Boolean |
getDefaultValueBoolean()
Return the boolean value this column should default to. |
DatabaseFunction |
getDefaultValueComputed()
Return the function whose value should generate this column's default. |
Date |
getDefaultValueDate()
Return the date value this column should default to. |
Number |
getDefaultValueNumeric()
Return the numeric value this column should default to. |
Object |
getDefaultValueObject()
Return the value to set this column's default to according to the setDefaultValue* function that was called. |
SequenceNextValueFunction |
getDefaultValueSequenceNext()
|
Boolean |
getDescending()
|
String |
getEncoding()
Return encoding of a file, referenced via valueClobFile . |
BigInteger |
getIncrementBy()
Return the amount to auto increment by. |
String |
getName()
The name of the column. |
String |
getRemarks()
Return the remarks to apply to this column. |
LiquibaseSerializable.SerializationType |
getSerializableFieldType(String field)
|
String |
getSerializedObjectName()
|
String |
getSerializedObjectNamespace()
|
BigInteger |
getStartWith()
Return the number to start auto incrementing with. |
String |
getType()
The data type fof the column. |
String |
getValue()
The String value to set this column to. |
String |
getValueBlobFile()
Return the file containing the data to load into a BLOB. |
Boolean |
getValueBoolean()
Return the boolean value this column should be set to. |
String |
getValueClobFile()
Return the file containing the data to load into a CLOB. |
DatabaseFunction |
getValueComputed()
Return the function this column should be set from. |
Date |
getValueDate()
Return the date value this column should be set to. |
Number |
getValueNumeric()
Return the numeric value this column should be set to. |
Object |
getValueObject()
Return the value from whatever setValue* function was called. |
SequenceCurrentValueFunction |
getValueSequenceCurrent()
|
SequenceNextValueFunction |
getValueSequenceNext()
|
boolean |
hasDefaultValue()
Returns true if any of the setDefaultValue* functions have had a non-null value set |
Boolean |
isAutoIncrement()
Returns true if this Column should be set to be auto increment. |
void |
load(ParsedNode parsedNode,
ResourceAccessor resourceAccessor)
|
protected void |
loadConstraints(ParsedNode constraintsNode)
|
ColumnConfig |
setAutoIncrement(Boolean autoIncrement)
|
ColumnConfig |
setComputed(Boolean computed)
|
ColumnConfig |
setConstraints(ConstraintsConfig constraints)
|
ColumnConfig |
setDefaultValue(String defaultValue)
Sets the string default value to assign to this column. |
ColumnConfig |
setDefaultValueBoolean(Boolean defaultValueBoolean)
|
ColumnConfig |
setDefaultValueBoolean(String defaultValueBoolean)
Set the defaultValueBoolean based on a given string. |
ColumnConfig |
setDefaultValueComputed(DatabaseFunction defaultValueComputed)
|
ColumnConfig |
setDefaultValueDate(Date defaultValueDate)
|
ColumnConfig |
setDefaultValueDate(String defaultValueDate)
Set the date this column should default to. |
ColumnConfig |
setDefaultValueNumeric(Number defaultValueNumeric)
|
ColumnConfig |
setDefaultValueNumeric(String defaultValueNumeric)
Set the number this column should use as its default. |
ColumnConfig |
setDefaultValueSequenceNext(SequenceNextValueFunction defaultValueSequenceNext)
|
ColumnConfig |
setDescending(Boolean descending)
|
ColumnConfig |
setEncoding(String encoding)
|
ColumnConfig |
setIncrementBy(BigInteger incrementBy)
|
ColumnConfig |
setName(String name)
|
ColumnConfig |
setName(String name,
boolean computed)
|
ColumnConfig |
setRemarks(String remarks)
|
ColumnConfig |
setStartWith(BigInteger startWith)
|
ColumnConfig |
setType(String type)
|
ColumnConfig |
setValue(String value)
Sets the string value this column should be set to. |
ColumnConfig |
setValueBlobFile(String valueBlobFile)
|
ColumnConfig |
setValueBoolean(Boolean valueBoolean)
|
ColumnConfig |
setValueBoolean(String valueBoolean)
Set the valueBoolean based on a given string. |
ColumnConfig |
setValueClobFile(String valueClobFile)
|
ColumnConfig |
setValueComputed(DatabaseFunction valueComputed)
|
ColumnConfig |
setValueDate(Date valueDate)
|
ColumnConfig |
setValueDate(String valueDate)
Set the date this column should be set to. |
ColumnConfig |
setValueNumeric(Number valueNumeric)
|
ColumnConfig |
setValueNumeric(String valueNumeric)
Set the number this column should be set to. |
ColumnConfig |
setValueSequenceCurrent(SequenceCurrentValueFunction valueSequenceCurrent)
|
ColumnConfig |
setValueSequenceNext(SequenceNextValueFunction valueSequenceNext)
|
Methods inherited from class liquibase.serializer.AbstractLiquibaseSerializable |
---|
convertEscaped, getSerializableFieldDataTypeClass, getSerializableFieldDataTypeClassParameters, getSerializableFieldNamespace, getSerializableFields, getSerializableFieldValue, serialize, serializeValue, setSerializableFieldValue, shouldAutoLoad |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ColumnConfig(Column columnSnapshot)
Column
snapshot.
It will attempt to set as much as possible based on the information in the snapshot.
public ColumnConfig()
Method Detail |
---|
public String getName()
public ColumnConfig setName(String name)
public ColumnConfig setName(String name, boolean computed)
public Boolean getComputed()
public ColumnConfig setComputed(Boolean computed)
public String getType()
DataTypeFactory.fromDescription(String, liquibase.database.Database)
before being included in SQL.
public ColumnConfig setType(String type)
public String getValue()
setValue(String)
use a more specific function like getValueNumeric()
or the more generic getValueObject()
If performing an data manipulation operation, the setValue* functions should be used to set what the columns should be set to.
If performing a data definition operation, this setValue* functions should be used to set what existing rows should be set to (may be different than the default value for new rows)
public ColumnConfig setValue(String value)
setValueNumeric(Number)
.
This method does no processing of the string. Any trimming is expected to be done beforehand. It does not conver the string "null" to null
so that you can set the string "null" as a value if you are feeling particularly crazy.
public Number getValueNumeric()
setValue(String)
public ColumnConfig setValueNumeric(String valueNumeric)
public ColumnConfig setValueNumeric(Number valueNumeric)
public Boolean getValueBoolean()
setValue(String)
public ColumnConfig setValueBoolean(Boolean valueBoolean)
public ColumnConfig setValueBoolean(String valueBoolean)
public DatabaseFunction getValueComputed()
setValue(String)
public ColumnConfig setValueComputed(DatabaseFunction valueComputed)
public ColumnConfig setValueSequenceNext(SequenceNextValueFunction valueSequenceNext)
public SequenceNextValueFunction getValueSequenceNext()
public ColumnConfig setValueSequenceCurrent(SequenceCurrentValueFunction valueSequenceCurrent)
public SequenceCurrentValueFunction getValueSequenceCurrent()
public Date getValueDate()
setValue(String)
public ColumnConfig setValueDate(Date valueDate)
public ColumnConfig setValueDate(String valueDate)
ISODateFormat
.
If the passed value cannot be parsed as a date, it is assumed to be a function that returns a date.
If the string "null" is passed, it will set a null value.
public String getValueBlobFile()
setValue(String)
public ColumnConfig setValueBlobFile(String valueBlobFile)
public String getValueClobFile()
setValue(String)
public ColumnConfig setValueClobFile(String valueClobFile)
public String getEncoding()
valueClobFile
.
public ColumnConfig setEncoding(String encoding)
public Object getValueObject()
public String getDefaultValue()
setDefaultValue(String)
use a more specific function like getDefaultValueNumeric()
or the more generic getDefaultValueObject()
public ColumnConfig setDefaultValue(String defaultValue)
setDefaultValueNumeric(Number)
.
This method does no processing of the string. Any trimming is expected to be done beforehand. It does not convert the string "null" to null
so that you can set the string "null" as a value if you are feeling particularly crazy.
public Number getDefaultValueNumeric()
setDefaultValue(String)
public ColumnConfig setDefaultValueNumeric(Number defaultValueNumeric)
public ColumnConfig setDefaultValueNumeric(String defaultValueNumeric)
public Date getDefaultValueDate()
setDefaultValue(String)
public ColumnConfig setDefaultValueDate(String defaultValueDate)
ISODateFormat
.
If the passed value cannot be parsed as a date, it is assumed to be a function that returns a date.
If the string "null" or an empty string is passed, it will set a null value.
public ColumnConfig setDefaultValueDate(Date defaultValueDate)
public Boolean getDefaultValueBoolean()
setDefaultValue(String)
public ColumnConfig setDefaultValueBoolean(Boolean defaultValueBoolean)
public ColumnConfig setDefaultValueBoolean(String defaultValueBoolean)
public DatabaseFunction getDefaultValueComputed()
setDefaultValue(String)
public ColumnConfig setDefaultValueComputed(DatabaseFunction defaultValueComputed)
public Object getDefaultValueObject()
public ConstraintsConfig getConstraints()
public ColumnConfig setConstraints(ConstraintsConfig constraints)
public Boolean isAutoIncrement()
public ColumnConfig setAutoIncrement(Boolean autoIncrement)
public BigInteger getStartWith()
public ColumnConfig setStartWith(BigInteger startWith)
public BigInteger getIncrementBy()
public ColumnConfig setIncrementBy(BigInteger incrementBy)
public boolean hasDefaultValue()
public String getRemarks()
public ColumnConfig setRemarks(String remarks)
public Boolean getDescending()
public ColumnConfig setDescending(Boolean descending)
public String getSerializedObjectName()
public SequenceNextValueFunction getDefaultValueSequenceNext()
public ColumnConfig setDefaultValueSequenceNext(SequenceNextValueFunction defaultValueSequenceNext)
public LiquibaseSerializable.SerializationType getSerializableFieldType(String field)
getSerializableFieldType
in interface LiquibaseSerializable
getSerializableFieldType
in class AbstractLiquibaseSerializable
public String getSerializedObjectNamespace()
public void load(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException
load
in interface LiquibaseSerializable
load
in class AbstractLiquibaseSerializable
ParsedNodeException
protected void loadConstraints(ParsedNode constraintsNode) throws ParsedNodeException
ParsedNodeException
public static ColumnConfig fromName(String name)
public static ColumnConfig[] arrayFromNames(String names)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |