org.opensubsystems.core.persist.db
Interface ModifiableDatabaseSchema

All Superinterfaces:
DatabaseSchema
All Known Implementing Classes:
ModifiableDatabaseSchemaImpl

public interface ModifiableDatabaseSchema
extends DatabaseSchema

Interface representing database schema, which is set of related database objects such as tables, constraints and indexes. One database instance will usually consists of multiple schemas coresponding to components used in the application. Each component or subsystem will provide one or multiple database schemas, which will be responsible for creation of all database structures for this components, for the upgrade of existing database structures to the latest version and also will encapsulate all specific database dependent information (such as database dependent queries).

Version:
$Id: ModifiableDatabaseSchema.java,v 1.1 2007/01/10 05:09:38 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
1.6 2006/07/21 22:47:38 jlegeny

Method Summary
 int deleteRelatedData(java.sql.Connection cntDBConnection, int iDataType, int iId)
          Method deletes related child data when main data object is being deleted.
 java.util.Map getModifiableTableNames()
          Get the names of all tables that can be modified by the operations provided by this database schema (e.g.
 
Methods inherited from interface org.opensubsystems.core.persist.db.DatabaseSchema
create, getDependentSchemas, getName, getVersion, handleSQLException, isInDomain, upgrade
 

Method Detail

getModifiableTableNames

java.util.Map getModifiableTableNames()
Get the names of all tables that can be modified by the operations provided by this database schema (e.g. schema allows insert, update or delete on this table).

Returns:
Map - map of table names for particular schema. key = object data type value = table name null if the schema doesn't allow to modify any of the tables

deleteRelatedData

int deleteRelatedData(java.sql.Connection cntDBConnection,
                      int iDataType,
                      int iId)
                      throws OSSException,
                             java.sql.SQLException
Method deletes related child data when main data object is being deleted. This method has to be overriden for databases that don't support cascade delete (eg. Sybase ASE).

Parameters:
cntDBConnection - - valid connection to database
iDataType - - data type identifying what to delete
iId - - ID of the record that has to be deleted
Returns:
int - number of deleted records
Throws:
OSSException - - problem deleting related data
java.sql.SQLException - - problem deleting related data


Copyright © 2003 - 2006 OpenSubsystems s.r.o.