Top Description Fields Constructors Methods
org.apache.derby.iapi.sql.dictionary

public Class SequenceDescriptor

extends PrivilegedSQLObject
implements Provider, Dependent
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.depend.Dependent, org.apache.derby.catalog.Dependable, org.apache.derby.iapi.sql.depend.Provider
Imports
org.apache.derby.catalog.UUID, .DependableFinder, .Dependable, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.io.StoredFormatIds, org.apache.derby.iapi.sql.depend.Provider, .DependencyManager, .Dependent, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.types.DataTypeDescriptor, org.apache.derby.iapi.store.access.TransactionController

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

Modifier and TypeField and Description
private boolean
private Long
private DataTypeDescriptor
private long
private long
private long
private final SchemaDescriptor
private UUID
private String
private UUID
private long

Constructor Summary

AccessConstructor and Description
public
SequenceDescriptor(DataDictionary
data dictionary
dataDictionary
,
SchemaDescriptor sd, UUID
unique identification in time and space of this sequence descriptor
sequenceUUID
,
String sequenceName, DataTypeDescriptor dataType, Long currentValue, long startValue, long minimumValue, long maximumValue, long increment, boolean canCycle)

Constructor

Method Summary

Modifier and TypeMethod and Description
public boolean
public void
drop(LanguageConnectionContext lcc)

Drop this sequence descriptor.

public String

Returns:

char The provider's type.
getClassType
()

Implements org.apache.derby.catalog.Dependable.getClassType.

Get the provider's type.

public Long
public DataTypeDescriptor
public DependableFinder

Returns:

the stored form of this provider
getDependableFinder
()

Implements org.apache.derby.catalog.Dependable.getDependableFinder.

Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.

public String
public String
getDescriptorType()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorType.

Each descriptor must identify itself with its type; i.e index, check constraint whatever.

public long
public long
public long
public String
getName()

Implements abstract org.apache.derby.iapi.sql.dictionary.UniqueSQLObjectDescriptor.getName.

Get the name of this object.

public UUID

Returns:

The provider's UUID
getObjectID
()

Implements org.apache.derby.catalog.Dependable.getObjectID.

Get the provider's UUID

public String

Returns:

String The name of this provider.
getObjectName
()

Implements org.apache.derby.catalog.Dependable.getObjectName.

Return the name of this Provider.

public String
getObjectTypeName()

Implements abstract org.apache.derby.iapi.sql.dictionary.PrivilegedSQLObject.getObjectTypeName.

Get the type of the object for storage in SYS.SYSPERMS

public SchemaDescriptor
public UUID
public String
public long
public UUID
getUUID()

Implements abstract org.apache.derby.iapi.sql.dictionary.UniqueTupleDescriptor.getUUID.

Return the UUID for this Descriptor

public boolean

Returns:

boolean Whether or not this provider is persistent.
isPersistent
()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.isPersistent.

Implements org.apache.derby.catalog.Dependable.isPersistent.

Is this provider persistent?

public synchronized boolean

Returns:

true if the dependent is currently valid
isValid
()

Implements org.apache.derby.iapi.sql.depend.Dependent.isValid.

Check that all of the dependent's dependencies are valid.

public void
makeInvalid(int
The action causing the invalidation
action
,
LanguageConnectionContext
the language connection context
lcc
)

Implements org.apache.derby.iapi.sql.depend.Dependent.makeInvalid.

Mark the dependent as invalid (due to at least one of its dependencies being invalid).

public void
prepareToInvalidate(Provider
the provider
p
,
int
The action causing the invalidation
action
,
LanguageConnectionContext
the language connection context
lcc
)

Implements org.apache.derby.iapi.sql.depend.Dependent.prepareToInvalidate.

Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Field Detail

canCycleback to summary
private boolean canCycle
currentValueback to summary
private Long currentValue
dataTypeback to summary
private DataTypeDescriptor dataType
incrementback to summary
private long increment
maximumValueback to summary
private long maximumValue
minimumValueback to summary
private long minimumValue
schemaDescriptorback to summary
private final SchemaDescriptor schemaDescriptor
schemaIdback to summary
private UUID schemaId
sequenceNameback to summary
private String sequenceName
sequenceUUIDback to summary
private UUID sequenceUUID
startValueback to summary
private long startValue

Constructor Detail

SequenceDescriptorback to summary
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:DataDictionary

data dictionary

sequenceUUID:UUID

unique identification in time and space of this sequence descriptor

Method Detail

canCycleback to summary
public boolean canCycle()
dropback to summary
public void drop(LanguageConnectionContext lcc) throws StandardException

Drop this sequence descriptor. Only restricted drops allowed right now.

Exceptions
StandardException:
Could not be dropped.
getClassTypeback to summary
public String getClassType()

Implements org.apache.derby.catalog.Dependable.getClassType.

Get the provider's type.

Returns:String

char The provider's type.

getCurrentValueback to summary
public Long getCurrentValue()
getDataTypeback to summary
public DataTypeDescriptor getDataType()
getDependableFinderback to summary
public DependableFinder getDependableFinder()

Implements org.apache.derby.catalog.Dependable.getDependableFinder.

Doc from org.apache.derby.catalog.Dependable.getDependableFinder.

Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.

Returns:DependableFinder

the stored form of this provider

See Also
Dependable#getDependableFinder
getDescriptorNameback to summary
public String getDescriptorName()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorName.

See Also
TupleDescriptor#getDescriptorName
getDescriptorTypeback to summary
public String getDescriptorType()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorType.

Doc from org.apache.derby.iapi.sql.dictionary.TupleDescriptor.getDescriptorType.

Each descriptor must identify itself with its type; i.e index, check constraint whatever.

See Also
TupleDescriptor#getDescriptorType
getIncrementback to summary
public long getIncrement()
getMaximumValueback to summary
public long getMaximumValue()
getMinimumValueback to summary
public long getMinimumValue()
getNameback to summary
public String getName()

Implements abstract org.apache.derby.iapi.sql.dictionary.UniqueSQLObjectDescriptor.getName.

Doc from org.apache.derby.iapi.sql.dictionary.UniqueSQLObjectDescriptor.getName.

Get the name of this object. E.g. for a table descriptor, this will be the table name.

Returns:String

the name

getObjectIDback to summary
public UUID getObjectID()

Implements org.apache.derby.catalog.Dependable.getObjectID.

Get the provider's UUID

Returns:UUID

The provider's UUID

getObjectNameback to summary
public String getObjectName()

Implements org.apache.derby.catalog.Dependable.getObjectName.

Return the name of this Provider. (Useful for errors.)

Returns:String

String The name of this provider.

getObjectTypeNameback to summary
public String getObjectTypeName()

Implements abstract org.apache.derby.iapi.sql.dictionary.PrivilegedSQLObject.getObjectTypeName.

Doc from org.apache.derby.iapi.sql.dictionary.PrivilegedSQLObject.getObjectTypeName.

Get the type of the object for storage in SYS.SYSPERMS

See Also
PrivilegedSQLObject#getObjectTypeName
getSchemaDescriptorback to summary
public SchemaDescriptor getSchemaDescriptor() throws StandardException

Implements abstract org.apache.derby.iapi.sql.dictionary.UniqueSQLObjectDescriptor.getSchemaDescriptor.

Doc from org.apache.derby.iapi.sql.dictionary.UniqueSQLObjectDescriptor.getSchemaDescriptor.

Get the objects schema descriptor

Returns:SchemaDescriptor

the schema descriptor

Exceptions
StandardException:
on error
getSchemaIdback to summary
public UUID getSchemaId()
getSequenceNameback to summary
public String getSequenceName()
getStartValueback to summary
public long getStartValue()
getUUIDback to summary
public UUID getUUID()

Implements abstract org.apache.derby.iapi.sql.dictionary.UniqueTupleDescriptor.getUUID.

Doc from org.apache.derby.iapi.sql.dictionary.UniqueTupleDescriptor.getUUID.

Return the UUID for this Descriptor

Returns:UUID

the uuid

See Also
UniqueTupleDescriptor#getUUID
isPersistentback to summary
public boolean isPersistent()

Overrides org.apache.derby.iapi.sql.dictionary.TupleDescriptor.isPersistent.

Implements org.apache.derby.catalog.Dependable.isPersistent.

Is this provider persistent? A stored dependency will be required if both the dependent and provider are persistent.

Returns:boolean

boolean Whether or not this provider is persistent.

isValidback to summary
public synchronized boolean isValid()

Implements org.apache.derby.iapi.sql.depend.Dependent.isValid.

Check that all of the dependent's dependencies are valid.

Returns:boolean

true if the dependent is currently valid

makeInvalidback to summary
public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException

Implements org.apache.derby.iapi.sql.depend.Dependent.makeInvalid.

Mark the dependent as invalid (due to at least one of its dependencies being invalid).

Parameters
action:int

The action causing the invalidation

lcc:LanguageConnectionContext

the language connection context

Exceptions
StandardException:
thrown if called in sanity mode
prepareToInvalidateback to summary
public void prepareToInvalidate(Provider p, int action, LanguageConnectionContext lcc) throws StandardException

Implements org.apache.derby.iapi.sql.depend.Dependent.prepareToInvalidate.

Prepare to mark the dependent as invalid (due to at least one of its dependencies being invalid).

Parameters
p:Provider

the provider

action:int

The action causing the invalidation

lcc:LanguageConnectionContext

the language connection context

Exceptions
StandardException:
thrown if unable to make it invalid
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Returns:String

a string representation of the object