Class SchemaDescriptor

All Implemented Interfaces:
Dependable, Provider

public final class SchemaDescriptor extends UniqueTupleDescriptor implements Provider
This class represents a schema descriptor
Version:
0.1
  • Field Details

    • STD_SYSTEM_SCHEMA_NAME

      public static final String STD_SYSTEM_SCHEMA_NAME
      STD_SYSTEM_SCHEMA_NAME is the name of the system schema in databases that use ANSI standard identifier casing. See org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext#getSystemSchemaName
      See Also:
    • IBM_SYSTEM_SCHEMA_NAME

      public static final String IBM_SYSTEM_SCHEMA_NAME
      See Also:
    • IBM_SYSTEM_CAT_SCHEMA_NAME

      public static final String IBM_SYSTEM_CAT_SCHEMA_NAME
      See Also:
    • IBM_SYSTEM_FUN_SCHEMA_NAME

      public static final String IBM_SYSTEM_FUN_SCHEMA_NAME
      See Also:
    • IBM_SYSTEM_PROC_SCHEMA_NAME

      public static final String IBM_SYSTEM_PROC_SCHEMA_NAME
      See Also:
    • IBM_SYSTEM_STAT_SCHEMA_NAME

      public static final String IBM_SYSTEM_STAT_SCHEMA_NAME
      See Also:
    • IBM_SYSTEM_NULLID_SCHEMA_NAME

      public static final String IBM_SYSTEM_NULLID_SCHEMA_NAME
      See Also:
    • STD_SQLJ_SCHEMA_NAME

      public static final String STD_SQLJ_SCHEMA_NAME
      This schema is used for jar handling procedures.
      See Also:
    • STD_SYSTEM_DIAG_SCHEMA_NAME

      public static final String STD_SYSTEM_DIAG_SCHEMA_NAME
      This schema is for Derby specific system diagnostic procedures and functions which are not available in DB2.
      See Also:
    • STD_SYSTEM_UTIL_SCHEMA_NAME

      public static final String STD_SYSTEM_UTIL_SCHEMA_NAME
      This schema is for Derby specific system diagnostic procedures and functions which are not available in DB2.
      See Also:
    • STD_DEFAULT_SCHEMA_NAME

      public static final String STD_DEFAULT_SCHEMA_NAME
      STD_DEFAULT_SCHEMA_NAME is the name of the default schema in databases that use ANSI standard identifier casing. See org.apache.derby.impl.sql.conn.GenericLanguageConnectionContext#getDefaultSchemaName
      See Also:
    • SYSCAT_SCHEMA_UUID

      public static final String SYSCAT_SCHEMA_UUID
      UUID's used as key's in the SYSSCHEMA catalog for the system schema's
      See Also:
    • SYSFUN_SCHEMA_UUID

      public static final String SYSFUN_SCHEMA_UUID
      See Also:
    • SYSPROC_SCHEMA_UUID

      public static final String SYSPROC_SCHEMA_UUID
      See Also:
    • SYSSTAT_SCHEMA_UUID

      public static final String SYSSTAT_SCHEMA_UUID
      See Also:
    • SYSCS_DIAG_SCHEMA_UUID

      public static final String SYSCS_DIAG_SCHEMA_UUID
      See Also:
    • SYSCS_UTIL_SCHEMA_UUID

      public static final String SYSCS_UTIL_SCHEMA_UUID
      See Also:
    • NULLID_SCHEMA_UUID

      public static final String NULLID_SCHEMA_UUID
      See Also:
    • SQLJ_SCHEMA_UUID

      public static final String SQLJ_SCHEMA_UUID
      See Also:
    • SYSTEM_SCHEMA_UUID

      public static final String SYSTEM_SCHEMA_UUID
      See Also:
    • SYSIBM_SCHEMA_UUID

      public static final String SYSIBM_SCHEMA_UUID
      See Also:
    • DEFAULT_SCHEMA_UUID

      public static final String DEFAULT_SCHEMA_UUID
      See Also:
    • STD_DECLARED_GLOBAL_TEMPORARY_TABLES_SCHEMA_NAME

      public static final String STD_DECLARED_GLOBAL_TEMPORARY_TABLES_SCHEMA_NAME
      See Also:
    • DEFAULT_USER_NAME

      public static final String DEFAULT_USER_NAME
      See Also:
    • SA_USER_NAME

      public static final String SA_USER_NAME
      See Also:
    • name

      private final String name
      the public interface for this system:
      1. public String getSchemaName();
      2. public String getAuthorizationId();
      3. public void setUUID(UUID uuid);
      4. public boolean isSystemSchema();
    • oid

      private UUID oid
    • aid

      private String aid
    • isSystem

      private final boolean isSystem
    • isSYSIBM

      private final boolean isSYSIBM
    • collationType

      private int collationType
      For system schemas, the only possible value for collation type is UCS_BASIC. For user schemas, the collation type can be UCS_BASIC or TERRITORY_BASED.
  • Constructor Details

    • SchemaDescriptor

      public SchemaDescriptor(DataDictionary dataDictionary, String name, String aid, UUID oid, boolean isSystem)
      Constructor for a SchemaDescriptor.
      Parameters:
      dataDictionary -
      name - The schema descriptor for this table.
      aid - The authorization id
      oid - The object id
      isSystem - boolean, true iff this is a system schema, like SYS, SYSIBM, SYSCAT, SYSFUN, ....
  • Method Details

    • getSchemaName

      public String getSchemaName()
      Gets the name of the schema
      Returns:
      The schema name
    • getAuthorizationId

      public String getAuthorizationId()
      Gets the authorization id of the schema
      Returns:
      Authorization id lives in.
    • setAuthorizationId

      public void setAuthorizationId(String newAuthorizationID)
      Sets the authorization id of the schema. This is only used by the DataDictionary during boot in order to patch up the authorization ids on system schemas.
      Parameters:
      newAuthorizationID - What is is
    • getUUID

      public UUID getUUID()
      Gets the oid of the schema
      Specified by:
      getUUID in class UniqueTupleDescriptor
      Returns:
      An oid
    • setUUID

      public void setUUID(UUID oid)
      Sets the oid of the schema
      Parameters:
      oid - The object id
    • getCollationType

      public int getCollationType()
      Returns the collation type associated with this schema
      Returns:
      collation type
    • 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 interface Dependable
      Returns:
      the stored form of this provider
      See Also:
    • getObjectName

      public String getObjectName()
      Return the name of this Provider. (Useful for errors.)
      Specified by:
      getObjectName in interface Dependable
      Returns:
      String The name of this provider.
    • getObjectID

      public UUID getObjectID()
      Get the provider's UUID
      Specified by:
      getObjectID in interface Dependable
      Returns:
      String The provider's UUID
    • getClassType

      public String getClassType()
      Get the provider's type.
      Specified by:
      getClassType in interface Dependable
      Returns:
      String The provider's type.
    • toString

      public String toString()
      Prints the contents of the SchemaDescriptor
      Overrides:
      toString in class Object
      Returns:
      The contents as a String
    • equals

      public boolean equals(Object otherObject)
      Determine if two SchemaDescriptors are the same.
      Overrides:
      equals in class Object
      Parameters:
      otherObject - other schemadescriptor
      Returns:
      true if they are the same, false otherwise
    • isSystemSchema

      public boolean isSystemSchema()
      Indicate whether this is a system schema or not Examples of system schema's include: SYS, SYSIBM, SYSCAT, SYSFUN, SYSPROC, SYSSTAT, and SYSCS_DIAG
      Returns:
      true/false
    • isSchemaWithGrantableRoutines

      public boolean isSchemaWithGrantableRoutines()
      Indicate whether this is a system schema with grantable routines
      Returns:
      true/false
    • isSYSIBM

      public boolean isSYSIBM()
    • hashCode

      public int hashCode()
      Get a hashcode for this SchemaDescriptor
      Overrides:
      hashCode in class Object
      Returns:
      hashcode
    • getDescriptorName

      public String getDescriptorName()
      Overrides:
      getDescriptorName in class TupleDescriptor
      See Also:
    • getDescriptorType

      public String getDescriptorType()
      Description copied from class: TupleDescriptor
      Each descriptor must identify itself with its type; i.e index, check constraint whatever.
      Overrides:
      getDescriptorType in class TupleDescriptor
      See Also:
    • drop

      public void drop(LanguageConnectionContext lcc, Activation activation) throws StandardException
      Drop this schema. Drops the schema if it is empty. If the schema was the current default then the current default will be reset through the language connection context.
      Throws:
      StandardException - Schema could not be dropped.