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

public final Class ViewDescriptor

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

This is the implementation of ViewDescriptor. Users of View descriptors should only use the following methods:
  1. getUUID
  2. setUUID
  3. getViewText
  4. setViewName
  5. getCheckOptionType
  6. getCompSchemaId
Version
0.1

Field Summary

Modifier and TypeField and Description
private final int
private final UUID
public static final int
private UUID
private String
private final String

Constructor Summary

AccessConstructor and Description
public
ViewDescriptor(DataDictionary
The data dictionary that this descriptor lives in
dataDictionary
,
UUID
The UUID for the view
viewID
,
String
The name of the view
viewName
,
String
The text of the query expression from the view definition.
viewText
,
int
int check option type
checkOption
,
UUID
the schemaid to compile in
compSchemaId
)

Constructor for a ViewDescriptor.

Method Summary

Modifier and TypeMethod and Description
public void
drop(LanguageConnectionContext
current language connection context
lcc
,
SchemaDescriptor
schema descriptor
sd
,
TableDescriptor
table descriptor for this view
td
)

Drop this descriptor, if not already done.

private void
drop(LanguageConnectionContext
current language connection context
lcc
,
SchemaDescriptor
schema descriptor
sd
,
TableDescriptor
table descriptor for this view
td
,
int
action
action
)

Drop this descriptor, if not already done, due to action.

public int

Returns:

An identifier telling what type of check option is on the view.
getCheckOptionType
()

Gets an identifier telling what type of check option is on this view.

public String

Returns:

String The provider's type.
getClassType
()

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

Get the provider's type.

public UUID

Returns:

the schema UUID
getCompSchemaId
()

Get the compilation type schema id when this view was first bound.

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 UUID

Returns:

String 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 UUID

Returns:

The UUID of the view.
getUUID
()

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

Gets the UUID of the view.

public String

Returns:

A String containing the text of the CREATE VIEW statement that created the view
getViewText
()

Gets the text of the view definition.

public 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 LanguageConnectionContext
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 LanguageConnectionContext
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 void
setUUID(UUID
The UUID of the view.
uuid
)

Sets the UUID of the view.

public void
setViewName(String
The name of the view.
name
)

Sets the name of the view.

public String

Returns:

The contents as a String
toString
()

Overrides java.lang.Object.toString.

Prints the contents of the ViewDescriptor

Field Detail

checkOptionback to summary
private final int checkOption
compSchemaIdback to summary
private final UUID compSchemaId
NO_CHECK_OPTIONback to summary
public static final int NO_CHECK_OPTION
uuidback to summary
private UUID uuid
viewNameback to summary
private String viewName
viewTextback to summary
private final String viewText

Constructor Detail

ViewDescriptorback to summary
public ViewDescriptor(DataDictionary dataDictionary, UUID viewID, String viewName, String viewText, int checkOption, UUID compSchemaId)

Constructor for a ViewDescriptor.

Parameters
dataDictionary:DataDictionary

The data dictionary that this descriptor lives in

viewID:UUID

The UUID for the view

viewName:String

The name of the view

viewText:String

The text of the query expression from the view definition.

checkOption:int

int check option type

compSchemaId:UUID

the schemaid to compile in

Method Detail

dropback to summary
public void drop(LanguageConnectionContext lcc, SchemaDescriptor sd, TableDescriptor td) throws StandardException

Drop this descriptor, if not already done.

Parameters
lcc:LanguageConnectionContext

current language connection context

sd:SchemaDescriptor

schema descriptor

td:TableDescriptor

table descriptor for this view

Exceptions
StandardException:
standard error policy
dropback to summary
private void drop(LanguageConnectionContext lcc, SchemaDescriptor sd, TableDescriptor td, int action) throws StandardException

Drop this descriptor, if not already done, due to action. If action is not DependencyManager.DROP_VIEW, the descriptor is dropped due to dropping some other object, e.g. a table column.

Parameters
lcc:LanguageConnectionContext

current language connection context

sd:SchemaDescriptor

schema descriptor

td:TableDescriptor

table descriptor for this view

action:int

action

Exceptions
StandardException:
standard error policy
getCheckOptionTypeback to summary
public int getCheckOptionType()

Gets an identifier telling what type of check option is on this view.

Returns:int

An identifier telling what type of check option is on the view.

getClassTypeback to summary
public String getClassType()

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

Get the provider's type.

Returns:String

String The provider's type.

getCompSchemaIdback to summary
public UUID getCompSchemaId()

Get the compilation type schema id when this view was first bound.

Returns:UUID

the schema UUID

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
getNameback to summary
public String getName()
getObjectIDback to summary
public UUID getObjectID()

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

Get the provider's UUID

Returns:UUID

String 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.

getUUIDback to summary
public UUID getUUID()

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

Gets the UUID of the view.

Returns:UUID

The UUID of the view.

getViewTextback to summary
public String getViewText()

Gets the text of the view definition.

Returns:String

A String containing the text of the CREATE VIEW statement that created the view

isValidback to summary
public 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

Doc from org.apache.derby.iapi.sql.depend.Dependent.makeInvalid.

The LanguageConnectionContext

Exceptions
StandardException:
thrown if unable to make it invalid
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

Doc from org.apache.derby.iapi.sql.depend.Dependent.prepareToInvalidate.

The LanguageConnectionContext

Exceptions
StandardException:
thrown if unable to make it invalid
setUUIDback to summary
public void setUUID(UUID uuid)

Sets the UUID of the view.

Parameters
uuid:UUID

The UUID of the view.

setViewNameback to summary
public void setViewName(String name)

Sets the name of the view.

Parameters
name:String

The name of the view.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Prints the contents of the ViewDescriptor

Returns:String

The contents as a String