Field Summary |
---|
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 |
public static final String | IBM_SYSTEM_SCHEMA_NAME | |
public static final String | IBM_SYSTEM_CAT_SCHEMA_NAME | |
public static final String | IBM_SYSTEM_FUN_SCHEMA_NAME | |
public static final String | IBM_SYSTEM_PROC_SCHEMA_NAME | |
public static final String | IBM_SYSTEM_STAT_SCHEMA_NAME | |
public static final String | IBM_SYSTEM_NULLID_SCHEMA_NAME | |
public static final String | STD_SQLJ_SCHEMA_NAME | This schema is used for jar handling procedures.
* |
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. |
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. |
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 |
public static final String | SYSCAT_SCHEMA_UUID | UUID's used as key's in the SYSSCHEMA catalog for the system schema's
* |
public static final String | SYSFUN_SCHEMA_UUID | |
public static final String | SYSPROC_SCHEMA_UUID | |
public static final String | SYSSTAT_SCHEMA_UUID | |
public static final String | SYSCS_DIAG_SCHEMA_UUID | |
public static final String | SYSCS_UTIL_SCHEMA_UUID | |
public static final String | NULLID_SCHEMA_UUID | |
public static final String | SQLJ_SCHEMA_UUID | |
public static final String | SYSTEM_SCHEMA_UUID | |
public static final String | SYSIBM_SCHEMA_UUID | |
public static final String | DEFAULT_SCHEMA_UUID | |
public static final String | STD_DECLARED_GLOBAL_TEMPORARY_TABLES_SCHEMA_NAME | |
public static final String | DEFAULT_USER_NAME | |
public static final String | SA_USER_NAME | |
Constructor: |
public SchemaDescriptor(DataDictionary dataDictionary,
String name,
String aid,
UUID oid,
boolean isSystem) {
super (dataDictionary);
this.name = name;
this.aid = aid;
this.oid = oid;
this.isSystem = isSystem;
isSYSIBM = isSystem && IBM_SYSTEM_SCHEMA_NAME.equals(name);
if (isSystem)
collationType = dataDictionary.getCollationTypeOfSystemSchemas();
else
collationType = dataDictionary.getCollationTypeOfUserSchemas();
}
Constructor for a SchemaDescriptor. Parameters:
dataDictionary -
name - The schema descriptor for this table.
oid - The object id
aid - The authorizatin id
isSystem - boolean, true iff this is a system schema, like SYS,
SYSIBM, SYSCAT, SYSFUN, ....
|
Method from org.apache.derby.iapi.sql.dictionary.SchemaDescriptor Summary: |
---|
drop, equals, getAuthorizationId, getClassType, getCollationType, getDependableFinder, getDescriptorName, getDescriptorType, getObjectID, getObjectName, getSchemaName, getUUID, hashCode, isSYSIBM, isSchemaWithGrantableRoutines, isSystemSchema, setUUID, toString |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.apache.derby.iapi.sql.dictionary.SchemaDescriptor Detail: |
public void drop(LanguageConnectionContext lcc,
Activation activation) throws StandardException {
DataDictionary dd = getDataDictionary();
DependencyManager dm = dd.getDependencyManager();
TransactionController tc = lcc.getTransactionExecute();
//If user is attempting to drop SESSION schema and there is no physical SESSION schema, then throw an exception
//Need to handle it this special way is because SESSION schema is also used for temporary tables. If there is no
//physical SESSION schema, we internally generate an in-memory SESSION schema in order to support temporary tables
//But there is no way for the user to access that in-memory SESSION schema. Following if will be true if there is
//no physical SESSION schema and hence getSchemaDescriptor has returned an in-memory SESSION schema
if (getSchemaName().equals(SchemaDescriptor.STD_DECLARED_GLOBAL_TEMPORARY_TABLES_SCHEMA_NAME)
&& (getUUID() == null))
throw StandardException.newException(SQLState.LANG_SCHEMA_DOES_NOT_EXIST, getSchemaName());
/*
** Make sure the schema is empty.
** In the future we want to drop everything
** in the schema if it is CASCADE.
*/
if (!dd.isSchemaEmpty(this))
{
throw StandardException.newException(SQLState.LANG_SCHEMA_NOT_EMPTY, getSchemaName());
}
/* Prepare all dependents to invalidate. (This is there chance
* to say that they can't be invalidated. For example, an open
* cursor referencing a table/view that the user is attempting to
* drop.) If no one objects, then invalidate any dependent objects.
*/
dm.invalidateFor(this, DependencyManager.DROP_SCHEMA, lcc);
dd.dropSchemaDescriptor(getSchemaName(), tc);
/*
** If we have dropped the current default schema,
** then we will set the default to null. The
** LCC is free to set the new default schema to
** some system defined default.
*/
lcc.resetSchemaUsages(activation, getSchemaName());
}
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. |
public boolean equals(Object otherObject) {
if (!(otherObject instanceof SchemaDescriptor))
return false;
SchemaDescriptor other = (SchemaDescriptor) otherObject;
if ((oid != null) && (other.oid != null))
return oid.equals( other.oid);
return name.equals(other.name);
}
Determine if two SchemaDescriptors are the same. |
public String getAuthorizationId() {
return aid;
}
Gets the authorization id of the schema |
public String getClassType() {
return Dependable.SCHEMA;
}
|
public int getCollationType() {
return collationType;
}
Returns the collation type associated with this schema |
public DependableFinder getDependableFinder() {
// Is this OK?
return getDependableFinder(StoredFormatIds.SCHEMA_DESCRIPTOR_FINDER_V01_ID);
}
|
public String getDescriptorName() {
return name;
}
|
public String getDescriptorType() {
return "Schema";
}
|
public UUID getObjectID() {
return oid;
}
|
public String getObjectName() {
return name;
}
Return the name of this Provider. (Useful for errors.) |
public String getSchemaName() {
return name;
}
Gets the name of the schema |
public UUID getUUID() {
return oid;
}
Gets the oid of the schema |
public int hashCode() {
return oid.hashCode();
}
Get a hashcode for this SchemaDescriptor |
public boolean isSYSIBM() {
return isSYSIBM;
}
|
public boolean isSchemaWithGrantableRoutines() {
if (!isSystem)
return true;
if (name.equals(STD_SQLJ_SCHEMA_NAME) || name.equals(STD_SYSTEM_UTIL_SCHEMA_NAME))
return true;
return false;
}
Indicate whether this is a system schema with grantable routines |
public boolean isSystemSchema() {
return(isSystem);
}
Indicate whether this is a system schema or not
Examples of system schema's include:
SYS, SYSIBM, SYSCAT, SYSFUN, SYSPROC, SYSSTAT, and SYSCS_DIAG |
public void setUUID(UUID oid) {
this.oid = oid;
}
Sets the oid of the schema |
public String toString() {
return name;
}
Prints the contents of the SchemaDescriptor |