org.mmbase.storage.implementation.database
Class ViewDatabaseStorageManager

java.lang.Object
  extended by org.mmbase.storage.implementation.database.DatabaseStorageManager
      extended by org.mmbase.storage.implementation.database.ViewDatabaseStorageManager
All Implemented Interfaces:
StorageManager<DatabaseStorageManagerFactory>

public class ViewDatabaseStorageManager
extends DatabaseStorageManager

Since:
MMBase-1.8
Version:
$Id: ViewDatabaseStorageManager.java 38544 2009-09-09 23:02:45Z michiel $
Javadoc:

Nested Class Summary
 
Nested classes/interfaces inherited from class org.mmbase.storage.implementation.database.DatabaseStorageManager
DatabaseStorageManager.InputStreamBlob
 
Field Summary
 
Fields inherited from class org.mmbase.storage.implementation.database.DatabaseStorageManager
activeConnection, changes, factory, inTransaction, OBJ2TYPE_MAX_SIZE, sequenceKeys, transactionIsolation, typeCache
 
Constructor Summary
ViewDatabaseStorageManager()
           
 
Method Summary
 void change(MMObjectNode node, MMObjectBuilder builder)
          Changes a node in the passed builder and all its parent builders
 void create()
          Create the basic elements for this storage
protected  void create(Index index)
          Override the default version.
 void create(MMObjectBuilder builder)
          Create a storage element to store the specified builder's objects.
 void create(MMObjectNode node, MMObjectBuilder builder)
          This method inserts a new object in a specific builder, and registers the change.
protected  void createObject(MMObjectNode node, MMObjectBuilder builder)
          This method inserts a new object in a specific builder, and registers the change.
 void delete(MMObjectNode node, MMObjectBuilder builder)
          Deletes a node in the passed builder and all its parent builders.
 boolean exists()
          Determine if the basic storage elements exist Basic storage elements include the 'object' storage (where all objects and their types are registered).
protected  boolean exists(Index index)
          Determines if an index exists.
 boolean exists(MMObjectBuilder builder)
          Determine if a storage element exists for storing the given builder's objects
protected  String getFieldName(CoreField field)
           
 CoreField getNumberField()
           
 String getTableName(MMObjectBuilder builder)
           
 String getTableName(String viewname)
           
 String getViewName(MMObjectBuilder builder)
           
 String getViewName(String viewname)
           
 boolean isInheritedField(CoreField field)
           
 boolean viewCreate(MMObjectBuilder builder)
           
 boolean viewExists(MMObjectBuilder builder)
           
 
Methods inherited from class org.mmbase.storage.implementation.database.DatabaseStorageManager
addToTableNameCache, appendDirectory, appendField, beginTransaction, change, change, change, change, checkFile, commit, commitChange, convertLegacyBinaryFiles, create, create, create, createIndex, createIndices, createKey, createSequence, createTable, delete, delete, delete, delete, delete, deleteIndices, executeQuery, executeUpdate, executeUpdateCheckConnection, exists, exists, fillNode, getActiveConnection, getBinaryFile, getBinaryValue, getBlobFromDatabase, getBlobValue, getBlobValue, getBlobValue, getBooleanValue, getConstraintDefinition, getDateTimeValue, getFactory, getFieldDefinition, getFieldList, getFieldTypeDefinition, getInputStreamValue, getJDBCtoField, getLogStartTime, getNode, getNodeType, getStringValue, getStringValue, getValue, getVersion, getXMLValue, init, isBinaryColumnType, isNull, isPartOfBuilderDefinition, isVerified, logQuery, refresh, releaseActiveConnection, rollback, setBinaryValue, setBooleanValue, setDateTimeValue, setDecimalValue, setListValue, setNodeType, setNodeTypeLeaveRelations, setNodeTypeRememberRelations, setNodeValue, setNullValue, setNumericValue, setStringValue, setValue, setXMLValue, shorten, size, size, storeBinaryAsFile, tablesInheritFields, unloadShortedFields, verify, verifyTables
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ViewDatabaseStorageManager

public ViewDatabaseStorageManager()
Method Detail

exists

public boolean exists()
               throws StorageException
Determine if the basic storage elements exist Basic storage elements include the 'object' storage (where all objects and their types are registered).

Specified by:
exists in interface StorageManager<DatabaseStorageManagerFactory>
Overrides:
exists in class DatabaseStorageManager
Returns:
true if basic storage elements exist
Throws:
StorageException - if an error occurred while querying the storage

exists

public boolean exists(MMObjectBuilder builder)
               throws StorageException
Determine if a storage element exists for storing the given builder's objects

Specified by:
exists in interface StorageManager<DatabaseStorageManagerFactory>
Overrides:
exists in class DatabaseStorageManager
Parameters:
builder - the builder to check
Returns:
true if the storage element exists, false if it doesn't
Throws:
StorageException - if an error occurred while querying the storage

create

public void create()
            throws StorageException
Create the basic elements for this storage

Specified by:
create in interface StorageManager<DatabaseStorageManagerFactory>
Overrides:
create in class DatabaseStorageManager
Throws:
StorageException - if an error occurred during the creation of the object storage

create

public void create(MMObjectBuilder builder)
            throws StorageException
Create a storage element to store the specified builder's objects.

Specified by:
create in interface StorageManager<DatabaseStorageManagerFactory>
Overrides:
create in class DatabaseStorageManager
Parameters:
builder - the builder to create the storage element for
Throws:
StorageException - if an error occurred during the creation of the storage element
See Also:
StorageManager.create(org.mmbase.module.core.MMObjectBuilder)

create

public void create(MMObjectNode node,
                   MMObjectBuilder builder)
            throws StorageException
Description copied from class: DatabaseStorageManager
This method inserts a new object in a specific builder, and registers the change. This method makes it easier to implement relational databases, where you may need to update the node in more than one builder. Call this method for all involved builders if you use a relational database.

Overrides:
create in class DatabaseStorageManager
Parameters:
node - The node to insert. The node already needs to have a (new) number assigned
builder - the builder to store the node
Throws:
StorageException - if an error occurred during creation

createObject

protected void createObject(MMObjectNode node,
                            MMObjectBuilder builder)
                     throws StorageException
This method inserts a new object in a specific builder, and registers the change. This method makes it easier to implement relational databases, where you may need to update the node in more than one builder. Call this method for all involved builders if you use a relational database.

Parameters:
node - The node to insert. The node already needs to have a (new) number assigned
builder - the builder to store the node
Throws:
StorageException - if an error occurred during creation

change

public void change(MMObjectNode node,
                   MMObjectBuilder builder)
            throws StorageException
Changes a node in the passed builder and all its parent builders

Overrides:
change in class DatabaseStorageManager
Parameters:
node - The node to change
builder - the builder to change the node in
Throws:
StorageException - if an error occurred during change

delete

public void delete(MMObjectNode node,
                   MMObjectBuilder builder)
            throws StorageException
Deletes a node in the passed builder and all its parent builders.

Overrides:
delete in class DatabaseStorageManager
Parameters:
node - The node to delete
builder - the builder to delete the node in
Throws:
StorageException - if an error occurred during delete

getFieldName

protected String getFieldName(CoreField field)

isInheritedField

public boolean isInheritedField(CoreField field)

getNumberField

public CoreField getNumberField()

getTableName

public String getTableName(MMObjectBuilder builder)

getTableName

public String getTableName(String viewname)

getViewName

public String getViewName(MMObjectBuilder builder)

getViewName

public String getViewName(String viewname)

create

protected void create(Index index)
               throws StorageException
Override the default version. An index should only be created if all the fields are in this builder. Otherwise this will fail horrably.

Overrides:
create in class DatabaseStorageManager
Parameters:
index - the index to create
Throws:
StorageException

exists

protected boolean exists(Index index)
                  throws StorageException
Description copied from class: DatabaseStorageManager
Determines if an index exists. You should have an active connection before calling this method.

Overrides:
exists in class DatabaseStorageManager
Parameters:
index - the index to test
Throws:
StorageException - when a database error occurs

viewExists

public boolean viewExists(MMObjectBuilder builder)

viewCreate

public boolean viewCreate(MMObjectBuilder builder)


MMBase 2.0-SNAPSHOT - null