Class DefaultInfoImpl
java.lang.Object
org.apache.derby.catalog.types.DefaultInfoImpl
- All Implemented Interfaces:
Externalizable, Serializable, DefaultInfo, Formatable, TypedFormat
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intprivate static final intprivate Stringprivate DataValueDescriptorThis class implements Formatable.private Stringprivate String[]private int -
Constructor Summary
ConstructorsConstructorDescriptionPublic niladic constructor.DefaultInfoImpl(boolean isDefaultValueAutoinc, String defaultText, DataValueDescriptor defaultValue) Constructor for use with numeric typesDefaultInfoImpl(String defaultText, String[] referencedColumnNames, String originalCurrentSchema) Constructor for use with generated columns -
Method Summary
Modifier and TypeMethodDescriptionprivate static intcalcType(boolean isDefaultValueAutoinc) This function returns stored value for flags and so on.Get the text of a default.Get the default value.Return the name of the current schema when the default was created.String[]If this default is a generation clause, then return the names of other columns in the row which the generation clause references.intGet the formatID which corresponds to this class.booleanIs default value generated by auto increment?booleanReturn true if this is the generation clause for a generated column.voidRead this object from a stream of stored objects.voidsetDefaultValue(DataValueDescriptor defaultValue) Set the default value.toString()voidWrite this object to a stream of stored objects.
-
Field Details
-
defaultValue
This class implements Formatable. That means that it can write itself to and from a formatted stream. If you add more fields to this class, make sure that you also write/read them with the writeExternal()/readExternal() methods. If, inbetween releases, you add more fields to this class, then you should bump the version number emitted by the getTypeFormatId() method. -
defaultText
-
type
private int type -
referencedColumnNames
-
originalCurrentSchema
-
BITS_MASK_IS_DEFAULTVALUE_AUTOINC
private static final int BITS_MASK_IS_DEFAULTVALUE_AUTOINC- See Also:
-
BITS_MASK_IS_GENERATED_COLUMN
private static final int BITS_MASK_IS_GENERATED_COLUMN- See Also:
-
-
Constructor Details
-
DefaultInfoImpl
public DefaultInfoImpl()Public niladic constructor. Needed for Formatable interface to work. -
DefaultInfoImpl
public DefaultInfoImpl(boolean isDefaultValueAutoinc, String defaultText, DataValueDescriptor defaultValue) Constructor for use with numeric types- Parameters:
defaultText- The text of the default.
-
DefaultInfoImpl
public DefaultInfoImpl(String defaultText, String[] referencedColumnNames, String originalCurrentSchema) Constructor for use with generated columns- Parameters:
defaultText- Text of generation clause.referencedColumnNames- names of other columns in the base row which are mentioned in the generation clause.originalCurrentSchema- Schema in effect when the generate column was added to the table.
-
-
Method Details
-
getDefaultText
Description copied from interface:DefaultInfoGet the text of a default.- Specified by:
getDefaultTextin interfaceDefaultInfo- Returns:
- The text of the default.
- See Also:
-
getReferencedColumnNames
Description copied from interface:DefaultInfoIf this default is a generation clause, then return the names of other columns in the row which the generation clause references.- Specified by:
getReferencedColumnNamesin interfaceDefaultInfo- See Also:
-
getOriginalCurrentSchema
Description copied from interface:DefaultInfoReturn the name of the current schema when the default was created. This is filled in for generated columns.- Specified by:
getOriginalCurrentSchemain interfaceDefaultInfo- See Also:
-
toString
-
readExternal
Read this object from a stream of stored objects.- Specified by:
readExternalin interfaceExternalizable- Parameters:
in- read this.- Throws:
IOException- thrown on errorClassNotFoundException- thrown on error
-
writeExternal
Write this object to a stream of stored objects.- Specified by:
writeExternalin interfaceExternalizable- Parameters:
out- write bytes here.- Throws:
IOException- thrown on error
-
getTypeFormatId
public int getTypeFormatId()Get the formatID which corresponds to this class.- Specified by:
getTypeFormatIdin interfaceTypedFormat- Returns:
- the formatID of this class
-
getDefaultValue
Get the default value. (NOTE: This returns null if the default is not a constant.)- Returns:
- The default value.
-
setDefaultValue
Set the default value.- Parameters:
defaultValue- The default value.
-
isDefaultValueAutoinc
public boolean isDefaultValueAutoinc()Description copied from interface:DefaultInfoIs default value generated by auto increment?- Specified by:
isDefaultValueAutoincin interfaceDefaultInfo- Returns:
- true if always generated by auto increment.
- See Also:
-
isGeneratedColumn
public boolean isGeneratedColumn()Description copied from interface:DefaultInfoReturn true if this is the generation clause for a generated column.- Specified by:
isGeneratedColumnin interfaceDefaultInfo- See Also:
-
calcType
private static int calcType(boolean isDefaultValueAutoinc) This function returns stored value for flags and so on.
-