org.opensubsystems.inventory.persist.db.mysql
Class MySQLItemDatabaseSchema

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.ItemDatabaseSchema
                  extended by org.opensubsystems.inventory.persist.db.mysql.MySQLItemDatabaseSchema
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 MySQLItemDatabaseSchema
extends ItemDatabaseSchema

Database specific operations related to persistence of items in MySQL.

Version:
$Id: MySQLItemDatabaseSchema.java,v 1.6 2007/01/07 06:15:13 bastafidli Exp $
Author:
Julian Legeny
Code reviewer:
TODO: Review this code
Code reviewed:

Field Summary
 
Fields inherited from class org.opensubsystems.inventory.persist.db.ItemDatabaseSchema
ALL_ITEM_CATEGORY_MAP_COLUMNS, COL_MAP_CATEGORY_ID, COL_MAP_ITEM_ID, ITEM_DESCRIPTION_MAXLENGTH, ITEM_MANDATORY_RETRIEVE_COLUMNS, ITEM_NAME_MAXLENGTH, ITEM_NAMESTEM_MAXLENGTH, ITEM_SCHEMA_NAME, ITEM_SCHEMA_VERSION, ITEM_SIZE_MAXLENGTH, ITEM_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
MySQLItemDatabaseSchema()
          Default constructor.
 
Method Summary
 void create(java.sql.Connection cntDBConnection, java.lang.String strUserName)
          
protected  java.lang.String getChangeShippedAndAvailableCountSafelySQL()
          Method returns SQL statement for getChangeShippedAndAvailableCountSafely.
 java.lang.String getInsertItemAndFetchGeneratedValues()
          Get query that inserts a Item to the database and fetches database generated values such as the generated id and creation timestamp
 java.lang.String getUpdateItemAndFetchGeneratedValues()
          Get query that updates Item in the database and fetches database generated values such as the updated modification timestamp
 
Methods inherited from class org.opensubsystems.inventory.persist.db.ItemDatabaseSchema
createListIndexes, getChangeAvailableCountSQL, getChangeCountsSQL, getChangeOnHoldCountSQL, getChangeShippedAndAvailableCountSQL, getColumns, getCommonPartSelectCategory, getDeleteItemById, getDeleteItemCategoryMap, getInsertItem, getInsertItemCategoryMap, getJoinFromWhere, getResetCounts, getSelectCategories, getSelectEmptyCategories, getSelectIdsInCategory, getSelectItemById, getSelectItemByInventoryAndName, getToolsInExceptionReport, handleInsertItemTypeCategoryMappingException, handleSQLException, insertItemCategories, insertItemCategoryMap
 
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, 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
isExistingIndex
 
Methods inherited from interface org.opensubsystems.core.persist.db.DatabaseSchema
getDependentSchemas, getName, getVersion, isInDomain, upgrade
 

Constructor Detail

MySQLItemDatabaseSchema

public MySQLItemDatabaseSchema()
                        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

getInsertItemAndFetchGeneratedValues

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

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

getUpdateItemAndFetchGeneratedValues

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

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

getChangeShippedAndAvailableCountSafelySQL

protected java.lang.String getChangeShippedAndAvailableCountSafelySQL()
                                                               throws org.opensubsystems.core.error.OSSException
Method returns SQL statement for getChangeShippedAndAvailableCountSafely. This statement can be db dependent. TODO: For Miro: This is not better description ;-) How should I know if to call getChangeShippedAndAvailableCountSecure or just getChangeShippedAndAvailableCount. It would be nice to explain the difference or better the purpose of this method.

Specified by:
getChangeShippedAndAvailableCountSafelySQL in class ItemDatabaseSchema
Returns:
sql statement string
Throws:
org.opensubsystems.core.error.OSSException - - error in function


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