org.datanucleus.store.rdbms.table
Class ViewImpl

java.lang.Object
  extended by org.datanucleus.store.rdbms.table.AbstractTable
      extended by org.datanucleus.store.rdbms.table.ViewImpl
All Implemented Interfaces:
org.datanucleus.store.mapped.DatastoreContainerObject, Table
Direct Known Subclasses:
ClassView

public abstract class ViewImpl
extends AbstractTable

Representation of a View in a datastore (RDBMS).


Field Summary
 
Fields inherited from class org.datanucleus.store.rdbms.table.AbstractTable
columns, columnsByName, dba, existsInDatastore, identifier, LOCALISER, state, storeMgr
 
Constructor Summary
ViewImpl(org.datanucleus.store.mapped.DatastoreIdentifier name, RDBMSManager storeMgr)
          Constructor, taking the table identifier.
 
Method Summary
protected  void addColumnInternal(Column col)
          Method to add a Column to the View.
protected  java.util.List getSQLDropStatements()
          Internal method to generate the SQL statements for dropping the view.
 void postInitialize(org.datanucleus.ClassLoaderResolver clr)
          Post initilize.
 void preInitialize(org.datanucleus.ClassLoaderResolver clr)
          Pre initilize.
 boolean validate(java.sql.Connection conn, boolean validateColumnStructure, boolean autoCreate, java.util.Collection autoCreateErrors)
          Method to validate the view in the datastore.
 
Methods inherited from class org.datanucleus.store.rdbms.table.AbstractTable
addDatastoreField, allowDDLOutput, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getDatastoreField, getDatastoreFields, getDatastoreIdentifierFullyQualified, getDiscriminatorMapping, getDiscriminatorMetaData, getIdentifier, getSchemaName, getSQLCreateStatements, getStoreManager, getVersionMapping, getVersionMetaData, hasColumnName, hasDatastoreField, hashCode, isInitialized, isInitializedModified, isPKInitialized, isValidated, tableExistsInDatastore, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.datanucleus.store.rdbms.table.Table
initialize
 
Methods inherited from interface org.datanucleus.store.mapped.DatastoreContainerObject
getIDMapping, getMemberMapping
 

Constructor Detail

ViewImpl

public ViewImpl(org.datanucleus.store.mapped.DatastoreIdentifier name,
                RDBMSManager storeMgr)
Constructor, taking the table identifier.

Parameters:
name - The identifier for the table.
storeMgr - The Store Manager
Method Detail

preInitialize

public void preInitialize(org.datanucleus.ClassLoaderResolver clr)
Pre initilize. For things that must be initialized right after constructor

Parameters:
clr - the ClassLoaderResolver

postInitialize

public void postInitialize(org.datanucleus.ClassLoaderResolver clr)
Post initilize. For things that must be set after all classes have been initialized before

Parameters:
clr - the ClassLoaderResolver

validate

public boolean validate(java.sql.Connection conn,
                        boolean validateColumnStructure,
                        boolean autoCreate,
                        java.util.Collection autoCreateErrors)
                 throws java.sql.SQLException
Method to validate the view in the datastore. Validates the existence of the table, and then the specifications of the Columns.

Parameters:
conn - The JDBC Connection
validateColumnStructure - Whether to validate down to column structure, or just their existence
autoCreate - Whether to update the view to fix errors (not used).
autoCreateErrors - Errors found during the auto-create process
Returns:
Whether the database was modified
Throws:
java.sql.SQLException - Thrown when an error occurs in the JDBC calls

getSQLDropStatements

protected java.util.List getSQLDropStatements()
Internal method to generate the SQL statements for dropping the view.

Specified by:
getSQLDropStatements in class AbstractTable
Returns:
The List of SQL statements.

addColumnInternal

protected void addColumnInternal(Column col)
Method to add a Column to the View.

Overrides:
addColumnInternal in class AbstractTable
Parameters:
col - The column


Copyright © 2009. All Rights Reserved.