Class AliasDescriptor
- java.lang.Object
-
- All Implemented Interfaces:
Dependable
,Dependent
,Provider
public final class AliasDescriptor extends PrivilegedSQLObject implements Provider, Dependent
This class represents an Alias Descriptor. The public methods for this class are:- getUUID
- getJavaClassName
- getAliasType
- getNameSpace
- getSystemAlias
- getAliasId
-
-
Field Summary
Fields Modifier and Type Field Description private UUID
aliasID
private AliasInfo
aliasInfo
private java.lang.String
aliasName
private char
aliasType
private java.lang.String
javaClassName
private char
nameSpace
private SchemaDescriptor
schemaDescriptor
private UUID
schemaID
private java.lang.String
specificName
private boolean
systemAlias
-
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
Constructors Constructor Description AliasDescriptor(DataDictionary dataDictionary, UUID aliasID, java.lang.String aliasName, UUID schemaID, java.lang.String javaClassName, char aliasType, char nameSpace, boolean systemAlias, AliasInfo aliasInfo, java.lang.String specificName)
Constructor for a AliasDescriptor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
drop(LanguageConnectionContext lcc)
Drop the routine or synonym.boolean
equals(java.lang.Object otherObject)
Determine if two AliasDescriptors are the same.AliasInfo
getAliasInfo()
Gests the AliasInfo for the alias.char
getAliasType()
Gets the type of the alias.static java.lang.String
getAliasType(char nameSpace)
java.lang.String
getClassType()
Get the provider's type.DependableFinder
getDependableFinder()
Get an object which can be written to disk and which, when read from disk, will find or reconstruct this in-memory Dependable.java.lang.String
getDescriptorName()
java.lang.String
getDescriptorType()
Each descriptor must identify itself with its type; i.e index, check constraint whatever.java.lang.String
getJavaClassName()
Gets the java class name of the alias.java.lang.String
getName()
Gets the name of the alias.char
getNameSpace()
Gets the name space of the alias.UUID
getObjectID()
Get the provider's UUIDjava.lang.String
getObjectName()
Return the name of this Provider.java.lang.String
getObjectTypeName()
Get the type of the object for storage in SYS.SYSPERMSjava.lang.String
getQualifiedName()
Gets the full, qualified name of the alias.SchemaDescriptor
getSchemaDescriptor()
Gets the SchemaDescriptor for this alias.java.lang.String
getSchemaName()
Gets the name of the schema that the alias lives in.UUID
getSchemaUUID()
Gets the UUID of the schema for this method alias.java.lang.String
getSpecificName()
Return the specific name for this object.boolean
getSystemAlias()
Gets whether or not the alias is a system alias.UUID
getUUID()
Gets the UUID of the method alias.int
hashCode()
Get a hashcode for this AliasDescriptorboolean
isPersistent()
Functions are persistent unless they are in the SYSFUN schema.boolean
isTableFunction()
Report whether this descriptor describes a Table Function.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).java.lang.String
toString()
Convert the AliasDescriptor to a String.-
Methods inherited from class org.apache.derby.iapi.sql.dictionary.TupleDescriptor
getColumnDependableFinder, getDataDictionary, getDependableFinder, setDataDictionary
-
-
-
-
Field Detail
-
aliasID
private final UUID aliasID
-
aliasName
private final java.lang.String aliasName
-
schemaID
private final UUID schemaID
-
javaClassName
private final java.lang.String javaClassName
-
aliasType
private final char aliasType
-
nameSpace
private final char nameSpace
-
systemAlias
private final boolean systemAlias
-
aliasInfo
private final AliasInfo aliasInfo
-
specificName
private final java.lang.String specificName
-
schemaDescriptor
private final SchemaDescriptor schemaDescriptor
-
-
Constructor Detail
-
AliasDescriptor
public AliasDescriptor(DataDictionary dataDictionary, UUID aliasID, java.lang.String aliasName, UUID schemaID, java.lang.String javaClassName, char aliasType, char nameSpace, boolean systemAlias, AliasInfo aliasInfo, java.lang.String specificName) throws StandardException
Constructor for a AliasDescriptor- Parameters:
dataDictionary
- The data dictionary that this descriptor lives inaliasID
- The UUID for this aliasaliasName
- The name of the method aliasschemaID
- The UUID for this alias's schemajavaClassName
- The java class name of the aliasaliasType
- The alias typenameSpace
- The alias name spacealiasInfo
- The AliasInfo for the alias- Throws:
StandardException
-
-
Method Detail
-
getUUID
public UUID getUUID()
Gets the UUID of the method alias.- Specified by:
getUUID
in classUniqueTupleDescriptor
- Returns:
- The UUID String of the method alias.
-
getObjectTypeName
public java.lang.String getObjectTypeName()
Description copied from class:PrivilegedSQLObject
Get the type of the object for storage in SYS.SYSPERMS- Specified by:
getObjectTypeName
in classPrivilegedSQLObject
- See Also:
PrivilegedSQLObject.getObjectTypeName()
-
getSchemaUUID
public UUID getSchemaUUID()
Gets the UUID of the schema for this method alias.- Returns:
- The UUID String of the schema id.
-
getSchemaDescriptor
public final SchemaDescriptor getSchemaDescriptor()
Gets the SchemaDescriptor for this alias.- Specified by:
getSchemaDescriptor
in classUniqueSQLObjectDescriptor
- Returns:
- SchemaDescriptor The SchemaDescriptor.
-
getName
public final java.lang.String getName()
Gets the name of the alias.- Specified by:
getName
in classUniqueSQLObjectDescriptor
- Returns:
- A String containing the name of the statement.
-
getSchemaName
public java.lang.String getSchemaName()
Gets the name of the schema that the alias lives in.- Returns:
- A String containing the name of the schema that the alias lives in.
-
getQualifiedName
public java.lang.String getQualifiedName()
Gets the full, qualified name of the alias.- Returns:
- A String containing the name of the table.
-
getJavaClassName
public java.lang.String getJavaClassName()
Gets the java class name of the alias.- Returns:
- The java class name of the alias.
-
getAliasType
public char getAliasType()
Gets the type of the alias.- Returns:
- The type of the alias.
-
getNameSpace
public char getNameSpace()
Gets the name space of the alias.- Returns:
- The name space of the alias.
-
getSystemAlias
public boolean getSystemAlias()
Gets whether or not the alias is a system alias.- Returns:
- Whether or not the alias is a system alias.
-
getAliasInfo
public AliasInfo getAliasInfo()
Gests the AliasInfo for the alias.- Returns:
- The AliasInfo for the alias.
-
toString
public java.lang.String toString()
Convert the AliasDescriptor to a String.- Overrides:
toString
in classjava.lang.Object
- Returns:
- A String representation of this AliasDescriptor
-
equals
public boolean equals(java.lang.Object otherObject)
Determine if two AliasDescriptors are the same.- Overrides:
equals
in classjava.lang.Object
- Parameters:
otherObject
- other descriptor- Returns:
- true if they are the same, false otherwise
-
hashCode
public int hashCode()
Get a hashcode for this AliasDescriptor- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- hashcode
-
getDependableFinder
public DependableFinder 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 representation
- See Also:
Dependable.getDependableFinder()
-
getObjectName
public java.lang.String getObjectName()
Return the name of this Provider. (Useful for errors.)- Specified by:
getObjectName
in interfaceDependable
- Returns:
- String The name of this provider.
-
getObjectID
public UUID getObjectID()
Get the provider's UUID- Specified by:
getObjectID
in interfaceDependable
- Returns:
- String The provider's UUID
-
getClassType
public java.lang.String getClassType()
Get the provider's type.- Specified by:
getClassType
in interfaceDependable
- Returns:
- String The provider's type.
-
getDescriptorType
public java.lang.String 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:
TupleDescriptor.getDescriptorType()
-
getAliasType
public static final java.lang.String getAliasType(char nameSpace)
-
getDescriptorName
public java.lang.String getDescriptorName()
- Overrides:
getDescriptorName
in classTupleDescriptor
- See Also:
TupleDescriptor.getDescriptorName()
-
getSpecificName
public java.lang.String getSpecificName()
Return the specific name for this object.
-
isPersistent
public boolean isPersistent()
Functions are persistent unless they are in the SYSFUN schema.- Specified by:
isPersistent
in interfaceDependable
- Overrides:
isPersistent
in classTupleDescriptor
- Returns:
- boolean Whether or not this provider is persistent.
-
isTableFunction
public boolean isTableFunction()
Report whether this descriptor describes a Table Function.
-
drop
public void drop(LanguageConnectionContext lcc) throws StandardException
Drop the routine or synonym. For a routine its permission descriptors will be dropped as well. For a synonym its TableDescriptor will be dropped as well.- Parameters:
lcc
-- Throws:
StandardException
-
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:
action
- The action causing the invalidationp
- the providerlcc
- The LanguageConnectionContext- Throws:
StandardException
- thrown if unable to make it invalid
-
makeInvalid
public void makeInvalid(int action, LanguageConnectionContext lcc) throws StandardException
Mark the dependent as invalid (due to at least one of its dependencies being invalid). Always an error for an alias -- should never have gotten here.- Specified by:
makeInvalid
in interfaceDependent
- Parameters:
action
- The action causing the invalidationlcc
- The LanguageConnectionContext- Throws:
StandardException
- thrown if called in sanity mode
-
-