org.opensubsystems.inventory.persist.db.sybase
Class SybaseCategoryDatabaseSchema

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
              extended by org.opensubsystems.inventory.persist.db.CategoryDatabaseSchema
                  extended by org.opensubsystems.inventory.persist.db.sybase.SybaseCategoryDatabaseSchema
All Implemented Interfaces:
org.opensubsystems.core.persist.db.DatabaseOperations, org.opensubsystems.core.persist.db.DatabaseSchema, org.opensubsystems.core.persist.db.ModifiableDatabaseSchema, org.opensubsystems.patterns.listdata.persist.db.ListDatabaseSchema

public class SybaseCategoryDatabaseSchema
extends CategoryDatabaseSchema

Database specific operations related to persistence of categories in Sybase.

Version:
$Id: SybaseCategoryDatabaseSchema.java,v 1.13 2007/01/07 06:14:53 bastafidli Exp $
Author:
Julian Legeny
Code reviewer:
Miro Halas
Code reviewed:
1.6 2006/02/21 06:02:00 bastafidli

Field Summary
 
Fields inherited from class org.opensubsystems.inventory.persist.db.CategoryDatabaseSchema
CATEGORY_DESCRIPTION_MAXLENGTH, CATEGORY_MANDATORY_RETRIEVE_COLUMNS, CATEGORY_NAME_MAXLENGTH, CATEGORY_SCHEMA_NAME, CATEGORY_SCHEMA_VERSION, CATEGORY_SORT_COLUMNS
 
Fields inherited from class org.opensubsystems.patterns.listdata.persist.db.impl.ModifiableListDatabaseSchemaImpl
m_mapFilterableColumns, m_mapListableTableNames, m_mapMandatoryRetrieveColumns, m_mapSortableColumns
 
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
SybaseCategoryDatabaseSchema()
          Default constructor.
 
Method Summary
 void create(java.sql.Connection cntDBConnection, java.lang.String strUserName)
          
 int deleteRoot(java.sql.Connection dbConnection, int iId, int iDomainId, org.opensubsystems.patterns.listdata.data.SimpleRule listSecurityData)
          Delete category and all its subcategories.
 int deleteRoots(java.sql.Connection dbConnection, int[] arrIds, int iDomainId, org.opensubsystems.patterns.listdata.data.SimpleRule listSecurityData)
          Delete multiple categories and its subcategories.
 java.lang.String getInsertCategoryAndFetchGeneratedValues()
          Get query that inserts a category to the database and fetches database generated values such as the generated id and creation timestamp
protected  java.lang.String getSelectCategoryExist(Category cCategory)
          Get sql query to find out if specified category exists.
 java.lang.String getUpdateCategoryAndFetchGeneratedValues()
          Get query that updates category in the database and fetches database generated values such as the updated modification timestamp
 
Methods inherited from class org.opensubsystems.inventory.persist.db.CategoryDatabaseSchema
createListIndexes, delete, deleteList, deleteRecursiveCategories, getColumns, getDeleteCategoriesCascade, getDeleteCategoryById, getDeleteCategoryCascade, getInsertCategory, getSelectActualCategoryCount, getSelectCategoryById, getSelectCategoryByParentIdAndName, getSelectCategoryCount, getSelectCategoryIDsForMoreParents, getSelectCategoryIDsForParent, handleSQLException
 
Methods inherited from class org.opensubsystems.patterns.listdata.persist.db.impl.ModifiableListDatabaseSchemaImpl
getFilterbleColumns, getMandatoryRetrieveColumns, getSelectList, getSortableColumns
 
Methods inherited from class org.opensubsystems.core.persist.db.ModifiableDatabaseSchemaImpl
deleteRelatedData, getModifiableTableNames
 
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
getJoinFromWhere, isExistingIndex
 
Methods inherited from interface org.opensubsystems.core.persist.db.DatabaseSchema
getDependentSchemas, getName, getVersion, isInDomain, upgrade
 

Constructor Detail

SybaseCategoryDatabaseSchema

public SybaseCategoryDatabaseSchema()
                             throws org.opensubsystems.core.error.OSSException
Default constructor.

Throws:
org.opensubsystems.core.error.OSSException - - error occured.
Method Detail

create

public void create(java.sql.Connection cntDBConnection,
                   java.lang.String strUserName)
            throws java.sql.SQLException,
                   org.opensubsystems.core.error.OSSException

Throws:
java.sql.SQLException
org.opensubsystems.core.error.OSSException

getSelectCategoryExist

protected java.lang.String getSelectCategoryExist(Category cCategory)
                                           throws org.opensubsystems.core.error.OSSException
Get sql query to find out if specified category exists.

Overrides:
getSelectCategoryExist in class CategoryDatabaseSchema
Parameters:
cCategory - - category object
Returns:
String - constructed sql query
Throws:
org.opensubsystems.core.error.OSSException - - error occured during constructing query

getInsertCategoryAndFetchGeneratedValues

public java.lang.String getInsertCategoryAndFetchGeneratedValues()
                                                          throws org.opensubsystems.core.error.OSSException
Get query that inserts a category to the database and fetches database generated values such as the generated id and creation timestamp

Specified by:
getInsertCategoryAndFetchGeneratedValues in class CategoryDatabaseSchema
Returns:
String - query for simple insert or stored procedure call
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

getUpdateCategoryAndFetchGeneratedValues

public java.lang.String getUpdateCategoryAndFetchGeneratedValues()
                                                          throws org.opensubsystems.core.error.OSSException
Get query that updates category in the database and fetches database generated values such as the updated modification timestamp

Specified by:
getUpdateCategoryAndFetchGeneratedValues in class CategoryDatabaseSchema
Returns:
String - query for simple update or stored procedure call
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured

deleteRoot

public int deleteRoot(java.sql.Connection dbConnection,
                      int iId,
                      int iDomainId,
                      org.opensubsystems.patterns.listdata.data.SimpleRule listSecurityData)
               throws org.opensubsystems.core.error.OSSException,
                      java.sql.SQLException
Delete category and all its subcategories. This method should delete all subcategories of the specified category. These will be also deleted only if the database supports cascade delete, if the database doesn't support cascade delete this method should be overriden for specific database.

Overrides:
deleteRoot in class CategoryDatabaseSchema
Parameters:
dbConnection - - database connection
iId - - data id that will be deleted
iDomainId - - domain id the deleted data belongs to
listSecurityData - - security data describing what data can be deleted
Returns:
int - number of deleted categories
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
java.sql.SQLException - - an error has occured

deleteRoots

public int deleteRoots(java.sql.Connection dbConnection,
                       int[] arrIds,
                       int iDomainId,
                       org.opensubsystems.patterns.listdata.data.SimpleRule listSecurityData)
                throws org.opensubsystems.core.error.OSSException,
                       java.sql.SQLException
Delete multiple categories and its subcategories. This method should delete all subcategories of the specified categories. These will be also deleted only if the database supports cascade delete, if the database doesn't support cascade delete this method should be overriden for specific database.

Overrides:
deleteRoots in class CategoryDatabaseSchema
Parameters:
dbConnection - - database connection
arrIds - - array of data ids that will be deleted
iDomainId - - domain id the deleted data belongs to
listSecurityData - - security data describing what data can be deleted
Returns:
int - number of deleted categories
Throws:
org.opensubsystems.core.error.OSSException - - an error has occured
java.sql.SQLException - - an error has occured


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