Class ViewImpl
- java.lang.Object
-
- org.datanucleus.store.rdbms.table.AbstractTable
-
- org.datanucleus.store.rdbms.table.ViewImpl
-
- All Implemented Interfaces:
Table
,org.datanucleus.store.schema.table.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, columnsByIdentifier, dba, existsInDatastore, identifier, state, storeMgr, TABLE_STATE_INITIALIZED, TABLE_STATE_INITIALIZED_MODIFIED, TABLE_STATE_NEW, TABLE_STATE_PK_INITIALIZED, TABLE_STATE_VALIDATED
-
-
Constructor Summary
Constructors Constructor Description ViewImpl(DatastoreIdentifier name, RDBMSStoreManager storeMgr)
Constructor, taking the table identifier.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addColumnInternal(Column col)
Method to add a Column to the View.protected List<String>
getSQLDropStatements()
Internal method to generate the SQL statements for dropping the view.boolean
validate(Connection conn, boolean validateColumnStructure, boolean autoCreate, Collection<Throwable> autoCreateErrors)
Method to validate the view in the datastore.-
Methods inherited from class org.datanucleus.store.rdbms.table.AbstractTable
addColumn, allowDDLOutput, assertIsInitialized, assertIsInitializedModified, assertIsPKInitialized, assertIsPKUninitialized, assertIsUninitialized, assertIsValidated, create, drop, equals, executeDdlStatement, executeDdlStatementList, exists, getCatalogName, getClassMetaData, getColumn, getColumnForName, getColumnForPosition, getColumns, getDatastoreIdentifierFullyQualified, getDiscriminatorMetaData, getIdentifier, getMemberColumnMappingForEmbeddedMember, getMemberColumnMappingForMember, getMemberColumnMappings, getName, getNumberOfColumns, getSchemaName, getSQLCreateStatements, getStoreManager, getSurrogateColumn, getSurrogateMapping, getVersionMetaData, hasColumn, hasColumnName, hashCode, isInitialized, isInitializedModified, isPKInitialized, isValidated, postInitialize, preInitialize, 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
getIdMapping, getMemberMapping, initialize
-
-
-
-
Constructor Detail
-
ViewImpl
public ViewImpl(DatastoreIdentifier name, RDBMSStoreManager storeMgr)
Constructor, taking the table identifier.- Parameters:
name
- The identifier for the table.storeMgr
- The Store Manager
-
-
Method Detail
-
validate
public boolean validate(Connection conn, boolean validateColumnStructure, boolean autoCreate, Collection<Throwable> autoCreateErrors) throws SQLException
Method to validate the view in the datastore. Validates the existence of the view, and then the specifications of the Columns.- Parameters:
conn
- The JDBC ConnectionvalidateColumnStructure
- Whether to validate down to column structure, or just their existenceautoCreate
- 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:
SQLException
- Thrown when an error occurs in the JDBC calls
-
getSQLDropStatements
protected List<String> getSQLDropStatements()
Internal method to generate the SQL statements for dropping the view.- Specified by:
getSQLDropStatements
in classAbstractTable
- Returns:
- The List of SQL statements.
-
addColumnInternal
protected void addColumnInternal(Column col)
Method to add a Column to the View.- Overrides:
addColumnInternal
in classAbstractTable
- Parameters:
col
- The column
-
-