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 boolean
private Long
private DataTypeDescriptor
private long
private long
private long
private final SchemaDescriptor
private UUID
private String
private UUID
private long
Fields inherited from interface org.apache.derby.catalog.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 TypeMethodDescriptionboolean
canCycle()
void
Drop 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.long
long
long
getName()
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 descriptorlong
getUUID()
Return the UUID for this Descriptorboolean
Is this provider persistent?boolean
isValid()
Check that all of the dependent's dependencies are valid.void
makeInvalid
(int action, LanguageConnectionContext lcc) Mark the dependent as invalid (due to at least one of its dependencies being invalid).void
prepareToInvalidate
(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 org.apache.derby.iapi.sql.dictionary.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:UniqueTupleDescriptor
Return the UUID for this Descriptor- Specified by:
getUUID
in classUniqueTupleDescriptor
- Returns:
- the uuid
- See Also:
-
getObjectTypeName
Description copied from class:PrivilegedSQLObject
Get the type of the object for storage in SYS.SYSPERMS- Specified by:
getObjectTypeName
in classPrivilegedSQLObject
- See Also:
-
toString
-
drop
Drop this sequence descriptor. Only restricted drops allowed right now.- Throws:
StandardException
- Could not be dropped.
-
isValid
public boolean isValid()Check that all of the dependent's dependencies are valid. -
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:
prepareToInvalidate
in 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:
makeInvalid
in 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:UniqueSQLObjectDescriptor
Get the name of this object. E.g. for a table descriptor, this will be the table name.- Specified by:
getName
in classUniqueSQLObjectDescriptor
- Returns:
- the name
-
getSchemaDescriptor
Description copied from class:UniqueSQLObjectDescriptor
Get the objects schema descriptor- Specified by:
getSchemaDescriptor
in classUniqueSQLObjectDescriptor
- Returns:
- the schema descriptor
- Throws:
StandardException
- on error
-
getDescriptorType
Description copied from class:TupleDescriptor
Each descriptor must identify itself with its type; i.e index, check constraint whatever.- Overrides:
getDescriptorType
in classTupleDescriptor
- See Also:
-
getDescriptorName
- Overrides:
getDescriptorName
in classTupleDescriptor
- See Also:
-
getObjectID
Get the provider's UUID- Specified by:
getObjectID
in 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:
isPersistent
in interfaceDependable
- Overrides:
isPersistent
in classTupleDescriptor
- Returns:
- boolean Whether or not this provider is persistent.
-
getObjectName
Return the name of this Provider. (Useful for errors.)- Specified by:
getObjectName
in interfaceDependable
- Returns:
- String The name of this provider.
-
getClassType
Get the provider's type.- Specified by:
getClassType
in interfaceDependable
- Returns:
- char The provider's type.
-
getDependableFinder
Description copied from interface:Dependable
Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.- Specified by:
getDependableFinder
in 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()
-