org.opensubsystems.patterns.listdata.persist.db.impl
Class ModifiableListDatabaseSchemaImpl

java.lang.Object
  extended by org.opensubsystems.core.persist.db.DatabaseSchemaImpl
      extended by org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
          extended by org.opensubsystems.patterns.listdata.persist.db.impl.ModifiableListDatabaseSchemaImpl
All Implemented Interfaces:
org.opensubsystems.core.persist.db.DatabaseOperations, org.opensubsystems.core.persist.db.DatabaseSchema, org.opensubsystems.core.persist.db.ModifiableDatabaseSchema, ListDatabaseSchema

public abstract class ModifiableListDatabaseSchemaImpl
extends org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
implements ListDatabaseSchema

Base class implementation for list database schemas that provide queries or operations that allow to modify data in tables managed by this schema as well as functionality needed to browse list of data objects.

Version:
$Id: ModifiableListDatabaseSchemaImpl.java,v 1.3 2007/02/01 07:24:13 bastafidli Exp $
Author:
Miro Halas
Code reviewer:
Miro Halas
Code reviewed:
Initial revision

Field Summary
protected  java.util.Map m_mapFilterableColumns
          Map of all filterable columns belonging to this schema.
protected  java.util.Map m_mapListableTableNames
          Map of all tables belonging to this schema that store data objects that can be accessed using the list data pattern.
protected  java.util.Map m_mapMandatoryRetrieveColumns
          Map of all columns belonging to this schema that have to be retrieved for a data object when a list of data objects is required.
protected  java.util.Map m_mapSortableColumns
          Map of all sortable columns belonging to this schema.
 
Fields inherited from class org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
m_mapModifiableTableNames
 
Fields inherited from class org.opensubsystems.core.persist.db.DatabaseSchemaImpl
DATABASE_SCHEMA_PREFIX, DATABASE_SCHEMA_PREFIX_DEFAULT, m_arrDependentSchemas, m_bIsInDomain, m_iSchemaVersion, m_strSchemaName, NL
 
Fields inherited from interface org.opensubsystems.core.persist.db.DatabaseOperations
DBOP_DELETE, DBOP_INSERT, DBOP_SELECT, DBOP_UPDATE
 
Constructor Summary
ModifiableListDatabaseSchemaImpl(org.opensubsystems.core.persist.db.DatabaseSchema[] arrDependentSchemas, java.lang.String strSchemaName, int iSchemaVersion, boolean bIsInDomain, java.lang.Integer iDataType, java.lang.String strTableName, int[] arrMandatoryRetrieveColumns, int[] arrSortableColumns, int[] arrFilterableColumns)
          Constructor allowing to specify attributes for database schema that support only single data object type and therefore have most likely only one table name and single columns sets.
ModifiableListDatabaseSchemaImpl(org.opensubsystems.core.persist.db.DatabaseSchema[] arrDependentSchemas, java.lang.String strSchemaName, int iSchemaVersion, boolean bIsInDomain, java.util.Map mapModifiableTableNames, java.lang.Integer iListableDataType, java.lang.String strListableTableName, int[] arrMandatoryRetrieveColumns, int[] arrSortableColumns, int[] arrFilterableColumns)
          Constructor allowing to specify attributes for database schema that support only single listable data object type and therefore have most likely only one single columns sets but may consist of multiple tables storing the data for a given data object that can be modified.
ModifiableListDatabaseSchemaImpl(org.opensubsystems.core.persist.db.DatabaseSchema[] arrDependentSchemas, java.lang.String strSchemaName, int iSchemaVersion, boolean bIsInDomain, java.util.Map mapModifiableTableNames, java.util.Map mapListableTableNames, java.util.Map mapMandatoryRetrieveColumns, java.util.Map mapSortableColumns, java.util.Map mapFilterableColumns)
          Constructor allowing to specify attributes for database schema that support multiple data object types and therefore have multiple sets of table names and columns sets.
 
Method Summary
 java.util.Map getFilterbleColumns()
          Get collection of all columns that can be used to sort data objects supported by this schema.
 java.util.Map getMandatoryRetrieveColumns()
          Get collection of all columns that has to be retrieved for each data object supported by this schema.
 java.lang.String getSelectList(ListOptions options, int iDataType)
          Get query to select list of data objects.
 java.util.Map getSortableColumns()
          Get collection of all columns that can be used to sort data objects supported by this schema.
 
Methods inherited from class org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
deleteRelatedData, getModifiableTableNames, handleSQLException
 
Methods inherited from class org.opensubsystems.core.persist.db.DatabaseSchemaImpl
getDependentSchemas, getJoinFromWhere, getName, getOwnerColumnNames, getSchemaPrefix, getVersion, isExistingIndex, isInDomain, upgrade, upgradeView
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.opensubsystems.patterns.listdata.persist.db.ListDatabaseSchema
getColumns, getJoinFromWhere, isExistingIndex
 
Methods inherited from interface org.opensubsystems.core.persist.db.DatabaseSchema
create, getDependentSchemas, getName, getVersion, handleSQLException, isInDomain, upgrade
 

Field Detail

m_mapListableTableNames

protected java.util.Map m_mapListableTableNames
Map of all tables belonging to this schema that store data objects that can be accessed using the list data pattern. Key is the data type, value is the string with the table name.


m_mapMandatoryRetrieveColumns

protected java.util.Map m_mapMandatoryRetrieveColumns
Map of all columns belonging to this schema that have to be retrieved for a data object when a list of data objects is required. Key is the data type, value is the int array (int[]) of column codes, which has to be retrieved for a given data object.


m_mapSortableColumns

protected java.util.Map m_mapSortableColumns
Map of all sortable columns belonging to this schema. Key is the data type, value is the int array (int[]) of column codes, which can be used for sorting the list of items.


m_mapFilterableColumns

protected java.util.Map m_mapFilterableColumns
Map of all filterable columns belonging to this schema. Key is the data type, value is the int array (int[]) of column codes, which can be used for filtering the list of items.

Constructor Detail

ModifiableListDatabaseSchemaImpl

public ModifiableListDatabaseSchemaImpl(org.opensubsystems.core.persist.db.DatabaseSchema[] arrDependentSchemas,
                                        java.lang.String strSchemaName,
                                        int iSchemaVersion,
                                        boolean bIsInDomain,
                                        java.util.Map mapModifiableTableNames,
                                        java.util.Map mapListableTableNames,
                                        java.util.Map mapMandatoryRetrieveColumns,
                                        java.util.Map mapSortableColumns,
                                        java.util.Map mapFilterableColumns)
                                 throws org.opensubsystems.core.error.OSSException
Constructor allowing to specify attributes for database schema that support multiple data object types and therefore have multiple sets of table names and columns sets.

Parameters:
arrDependentSchemas - - array of dependent schemas
strSchemaName - - name of the schema
iSchemaVersion - - version of the schema
bIsInDomain - - flag signaling if object is in domain
mapModifiableTableNames - - map of all tables belonging to this schema that can be modified by the schema (e.g. schema allows insert, update or delete on this table)
mapListableTableNames - - map of all tables belonging to this schema that store data objects that can be accessed using the list data pattern. Key is the data type, value is the string with the table name.
mapMandatoryRetrieveColumns - - map of all columns belonging to this schema that have to be retrieved for a data object when a list of data objects is required. Key is the data type, value is the int array (int[]) of column codes, which has to be retrieved for a given data object.
mapSortableColumns - - map of all sortable columns belonging to this schema. Key is the data type, value is the int array (int[]) of column codes, which can be used for sorting the list of items.
mapFilterableColumns - - map of all filterable columns belonging to this schema. Key is the data type, value is the int array (int[]) of column codes, which can be used for filtering the list of items.
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

ModifiableListDatabaseSchemaImpl

public ModifiableListDatabaseSchemaImpl(org.opensubsystems.core.persist.db.DatabaseSchema[] arrDependentSchemas,
                                        java.lang.String strSchemaName,
                                        int iSchemaVersion,
                                        boolean bIsInDomain,
                                        java.lang.Integer iDataType,
                                        java.lang.String strTableName,
                                        int[] arrMandatoryRetrieveColumns,
                                        int[] arrSortableColumns,
                                        int[] arrFilterableColumns)
                                 throws org.opensubsystems.core.error.OSSException
Constructor allowing to specify attributes for database schema that support only single data object type and therefore have most likely only one table name and single columns sets.

Parameters:
iDataType - - data type that can be modified and listed using operations in this schema
arrDependentSchemas - - array of dependent schemas
strSchemaName - - name of the schema
iSchemaVersion - - version of the schema
strTableName - - table belonging to this schema that can be modified by the schema (e.g. schema allows insert, update or delete on this table)
bIsInDomain - - flag signaling if object is in domain
arrMandatoryRetrieveColumns - - array of column codes of columns, which has to be retrieved for a given data object.
arrSortableColumns - - array of column codes of columns, which can be used for sorting the list of items.
arrFilterableColumns - - array of column codes of columns, which can be used for filtering the list of items.
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

ModifiableListDatabaseSchemaImpl

public ModifiableListDatabaseSchemaImpl(org.opensubsystems.core.persist.db.DatabaseSchema[] arrDependentSchemas,
                                        java.lang.String strSchemaName,
                                        int iSchemaVersion,
                                        boolean bIsInDomain,
                                        java.util.Map mapModifiableTableNames,
                                        java.lang.Integer iListableDataType,
                                        java.lang.String strListableTableName,
                                        int[] arrMandatoryRetrieveColumns,
                                        int[] arrSortableColumns,
                                        int[] arrFilterableColumns)
                                 throws org.opensubsystems.core.error.OSSException
Constructor allowing to specify attributes for database schema that support only single listable data object type and therefore have most likely only one single columns sets but may consist of multiple tables storing the data for a given data object that can be modified.

Parameters:
arrDependentSchemas - - array of dependent schemas
strSchemaName - - name of the schema
iSchemaVersion - - version of the schema
bIsInDomain - - flag signaling if object is in domain
mapModifiableTableNames - - map of all tables belonging to this schema that can be modified by the schema (e.g. schema allows insert, update or delete on this table)
iListableDataType - - data type that can be listed using the list data pattern in this schema
strListableTableName - - table belonging to this schema that stores data objects that can be accessed using the list data pattern
arrMandatoryRetrieveColumns - - array of column codes of columns, which has to be retrieved for a given data object.
arrSortableColumns - - array of column codes of columns, which can be used for sorting the list of items.
arrFilterableColumns - - array of column codes of columns, which can be used for filtering the list of items.
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
Method Detail

getMandatoryRetrieveColumns

public java.util.Map getMandatoryRetrieveColumns()
Get collection of all columns that has to be retrieved for each data object supported by this schema.

Specified by:
getMandatoryRetrieveColumns in interface ListDatabaseSchema
Returns:
Map - key is the data type, value is the int array (int[]) of column codes which has to be retrieved for a given data object.

getSortableColumns

public java.util.Map getSortableColumns()
Get collection of all columns that can be used to sort data objects supported by this schema.

Specified by:
getSortableColumns in interface ListDatabaseSchema
Returns:
Map - Key is the data type, value is the array of column codes (int[])which can be used for sorting.

getFilterbleColumns

public java.util.Map getFilterbleColumns()
Get collection of all columns that can be used to sort data objects supported by this schema.

Returns:
Map - Key is the data type, value is the array of column codes (int[])which can be used for sorting.

getSelectList

public java.lang.String getSelectList(ListOptions options,
                                      int iDataType)
                               throws org.opensubsystems.core.error.OSSException
Get query to select list of data objects.

Specified by:
getSelectList in interface ListDatabaseSchema
Parameters:
options - - options describing what data objects to retrieve
iDataType - - data type for which to retrieve the list
Returns:
String - query
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured


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