Class SequenceDescriptor
java.lang.Object
org.apache.derby.iapi.sql.dictionary.TupleDescriptor
org.apache.derby.iapi.sql.dictionary.UniqueTupleDescriptor
org.apache.derby.iapi.sql.dictionary.UniqueSQLObjectDescriptor
org.apache.derby.iapi.sql.dictionary.PrivilegedSQLObject
org.apache.derby.iapi.sql.dictionary.SequenceDescriptor
- All Implemented Interfaces:
Dependable, Dependent, Provider
This class is used by rows in the SYS.SYSSEQUENCES system table.
See the header comment of SYSSEQUENCESRowFactory for the
contract of that table. In particular, if the CURRENTVALUE column
is null, then the sequence has been exhausted and no more values
can be generated from it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate Longprivate DataTypeDescriptorprivate longprivate longprivate longprivate final SchemaDescriptorprivate UUIDprivate Stringprivate UUIDprivate longFields inherited from interface Dependable
ACTIVATION, ALIAS, COLUMNS_IN_TABLE, COLUMNS_PERMISSION, CONGLOMERATE, CONSTRAINT, DEFAULT, FILE, HEAP, INDEX, PERM, PREPARED_STATEMENT, ROLE_GRANT, ROUTINE_PERMISSION, SCHEMA, SEQUENCE, STORED_PREPARED_STATEMENT, TABLE, TABLE_PERMISSION, TRIGGER, VIEW -
Constructor Summary
ConstructorsConstructorDescriptionSequenceDescriptor(DataDictionary dataDictionary, SchemaDescriptor sd, UUID sequenceUUID, String sequenceName, DataTypeDescriptor dataType, Long currentValue, long startValue, long minimumValue, long maximumValue, long increment, boolean canCycle) Constructor -
Method Summary
Modifier and TypeMethodDescriptionbooleancanCycle()voidDrop this sequence descriptor.Get the provider's type.Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.Each descriptor must identify itself with its type; i.e index, check constraint whatever.longlonglonggetName()Get the name of this object.Get the provider's UUIDReturn the name of this Provider.Get the type of the object for storage in SYS.SYSPERMSGet the objects schema descriptorlonggetUUID()Return the UUID for this DescriptorbooleanIs this provider persistent?booleanisValid()Check that all of the dependent's dependencies are valid.voidmakeInvalid(int action, LanguageConnectionContext lcc) Mark the dependent as invalid (due to at least one of its dependencies being invalid).voidprepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).toString()Methods inherited from class TupleDescriptor
getColumnDependableFinder, getDataDictionary, getDependableFinder, setDataDictionary
-
Field Details
-
sequenceUUID
-
sequenceName
-
schemaDescriptor
-
schemaId
-
dataType
-
currentValue
-
startValue
private long startValue -
minimumValue
private long minimumValue -
maximumValue
private long maximumValue -
increment
private long increment -
canCycle
private boolean canCycle
-
-
Constructor Details
-
SequenceDescriptor
public SequenceDescriptor(DataDictionary dataDictionary, SchemaDescriptor sd, UUID sequenceUUID, String sequenceName, DataTypeDescriptor dataType, Long currentValue, long startValue, long minimumValue, long maximumValue, long increment, boolean canCycle) Constructor- Parameters:
dataDictionary- data dictionarysequenceUUID- unique identification in time and space of this sequence descriptorsequenceName-
-
-
Method Details
-
getUUID
Description copied from class:UniqueTupleDescriptorReturn the UUID for this Descriptor- Specified by:
getUUIDin classUniqueTupleDescriptor- Returns:
- the uuid
- See Also:
-
getObjectTypeName
Description copied from class:PrivilegedSQLObjectGet the type of the object for storage in SYS.SYSPERMS- Specified by:
getObjectTypeNamein classPrivilegedSQLObject- See Also:
-
toString
-
drop
Drop this sequence descriptor. Only restricted drops allowed right now.- Throws:
StandardException- Could not be dropped.
-
isValid
-
prepareToInvalidate
public void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).- Specified by:
prepareToInvalidatein interfaceDependent- Parameters:
p- the provideraction- The action causing the invalidationlcc- the language connection context- Throws:
StandardException- thrown if unable to make it invalid
-
makeInvalid
Mark the dependent as invalid (due to at least one of its dependencies being invalid).- Specified by:
makeInvalidin interfaceDependent- Parameters:
action- The action causing the invalidationlcc- the language connection context- Throws:
StandardException- thrown if called in sanity mode
-
getName
Description copied from class:UniqueSQLObjectDescriptorGet the name of this object. E.g. for a table descriptor, this will be the table name.- Specified by:
getNamein classUniqueSQLObjectDescriptor- Returns:
- the name
-
getSchemaDescriptor
Description copied from class:UniqueSQLObjectDescriptorGet the objects schema descriptor- Specified by:
getSchemaDescriptorin classUniqueSQLObjectDescriptor- Returns:
- the schema descriptor
- Throws:
StandardException- on error
-
getDescriptorType
Description copied from class:TupleDescriptorEach descriptor must identify itself with its type; i.e index, check constraint whatever.- Overrides:
getDescriptorTypein classTupleDescriptor- See Also:
-
getDescriptorName
- Overrides:
getDescriptorNamein classTupleDescriptor- See Also:
-
getObjectID
Get the provider's UUID- Specified by:
getObjectIDin interfaceDependable- Returns:
- The provider's UUID
-
isPersistent
public boolean isPersistent()Is this provider persistent? A stored dependency will be required if both the dependent and provider are persistent.- Specified by:
isPersistentin interfaceDependable- Overrides:
isPersistentin classTupleDescriptor- Returns:
- boolean Whether or not this provider is persistent.
-
getObjectName
Return the name of this Provider. (Useful for errors.)- Specified by:
getObjectNamein interfaceDependable- Returns:
- String The name of this provider.
-
getClassType
Get the provider's type.- Specified by:
getClassTypein interfaceDependable- Returns:
- char The provider's type.
-
getDependableFinder
Description copied from interface:DependableGet an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.- Specified by:
getDependableFinderin interfaceDependable- Returns:
- the stored form of this provider
- See Also:
-
getSequenceName
-
getSchemaId
-
getDataType
-
getCurrentValue
-
getStartValue
public long getStartValue() -
getMinimumValue
public long getMinimumValue() -
getMaximumValue
public long getMaximumValue() -
getIncrement
public long getIncrement() -
canCycle
public boolean canCycle()
-