org.opensubsystems.inventory.persist.db.postgresql
Class PostgreSQLUnitDatabaseSchema

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.UnitDatabaseSchema
                  extended by org.opensubsystems.inventory.persist.db.postgresql.PostgreSQLUnitDatabaseSchema
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 PostgreSQLUnitDatabaseSchema
extends UnitDatabaseSchema

Database specific operations related to persistence of units in Postgre SQL.

Version:
$Id: PostgreSQLUnitDatabaseSchema.java,v 1.7 2007/01/07 06:14:37 bastafidli Exp $
Author:
Julian Legeny
Code reviewer:
TODO: Review this code
Code reviewed:

Field Summary
 
Fields inherited from class org.opensubsystems.inventory.persist.db.UnitDatabaseSchema
UNIT_MANDATORY_RETRIEVE_COLUMNS, UNIT_SCHEMA_NAME, UNIT_SCHEMA_VERSION, UNIT_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
PostgreSQLUnitDatabaseSchema()
          Default constructor.
 
Method Summary
 void create(java.sql.Connection cntDBConnection, java.lang.String strUserName)
          
protected  java.lang.String getChangeShippedAndAvailableCountSecureSQL()
          Return sql statemnet string for change shipped and availbale in regular item, In regular item both available and shiped have to by nonnegative
protected  java.lang.String getChangeShippedAndAvailableCountSecureSQLFoundHolder()
          Return sql statemnet string for chnage shipped and availbale in found holder.
 java.lang.String getInsertUnitAndFetchGeneratedValues()
          Get query that inserts a Unit to the database and fetches database generated values such as the generated id and creation timestamp
 java.lang.String getUpdateUnitAndFetchGeneratedValues()
          Get query that updates Unit in the database and fetches database generated values such as the updated modification timestamp
 
Methods inherited from class org.opensubsystems.inventory.persist.db.UnitDatabaseSchema
createListIndexes, getChangeAvailableCountSQL, getChangeShippedAndAvailableCountSQL, getColumns, getDeleteUnitById, getInsertUnit, getResetCounts, getSelectAvailableItems, getSelectByItemAndCost, getSelectFoundHolder, getSelectUnitById, getSelectUnitsWithoutFoundHolder, getUpdateUnit, 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

PostgreSQLUnitDatabaseSchema

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

Throws:
java.sql.SQLException

getInsertUnitAndFetchGeneratedValues

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

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

getUpdateUnitAndFetchGeneratedValues

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

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

getChangeShippedAndAvailableCountSecureSQL

protected java.lang.String getChangeShippedAndAvailableCountSecureSQL()
                                                               throws org.opensubsystems.core.error.OSSException
Return sql statemnet string for change shipped and availbale in regular item, In regular item both available and shiped have to by nonnegative

Specified by:
getChangeShippedAndAvailableCountSecureSQL in class UnitDatabaseSchema
Returns:
String - sql statement
Throws:
org.opensubsystems.core.error.OSSException - - error in function

getChangeShippedAndAvailableCountSecureSQLFoundHolder

protected java.lang.String getChangeShippedAndAvailableCountSecureSQLFoundHolder()
                                                                          throws org.opensubsystems.core.error.OSSException
Return sql statemnet string for chnage shipped and availbale in found holder. In found holder item only shiped have to by nonnegative. Available can be negative.

Specified by:
getChangeShippedAndAvailableCountSecureSQLFoundHolder in class UnitDatabaseSchema
Returns:
String - sql statement
Throws:
org.opensubsystems.core.error.OSSException - - error in function


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