|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.persist.db.DatabaseFactoryImpl
org.opensubsystems.patterns.listdata.persist.db.impl.ListDatabaseFactoryImpl
org.opensubsystems.inventory.persist.db.UnitDatabaseFactory
public class UnitDatabaseFactory
Data factory to retrieve and manipulate units in persistence store.
| Field Summary | |
|---|---|
protected UnitDatabaseSchema |
m_schema
Schema to use to execute database dependent operations. |
| Fields inherited from class org.opensubsystems.patterns.listdata.persist.db.impl.ListDatabaseFactoryImpl |
|---|
m_arrOrderColumnCodes, m_arrOrderDirections, m_arrShowColumnCodes, m_listSchema |
| Fields inherited from class org.opensubsystems.core.persist.db.DatabaseFactoryImpl |
|---|
m_connectionFactory, m_iConcurrencySelectListResultSet, m_iDataType, m_iTypeSelectListResultSet, m_transactionFactory |
| Constructor Summary | |
|---|---|
UnitDatabaseFactory()
Default constructor. |
|
| Method Summary | |
|---|---|
boolean |
changeAvailableCount(int iUnitId,
int iValue)
Change the available count for specified unit by specified relative value. |
boolean |
changeAvailableCount(java.util.List lstChanges)
Change the available count for specified unit by specified relative values. |
protected int |
changeAvailableCount(java.sql.PreparedStatement updateStatement,
int iUnitId,
int iValue)
Change the available count for specified units by specified relative values. |
boolean |
changeShippedAndAvailableCount(int iUnitId,
int iValue)
Change the shipped and available count for specified unit by specified relative value. |
protected int |
changeShippedAndAvailableCount(java.sql.PreparedStatement updateStatement,
int iUnitId,
int iValue,
boolean isSecure)
Change the shipped and available count for specified units by specified relative values. |
boolean |
changeShippedAndAvailableCountSecure(int iUnitId,
int iValue)
Change the shipped and available count for specified unit by specified relative value. |
int |
create(java.util.Collection colDataObject)
|
org.opensubsystems.core.data.DataObject |
create(org.opensubsystems.core.data.DataObject data)
|
void |
delete(int iId,
int iDomainId)
|
Unit |
get(int iItemId,
double dCost)
Get unit based on the item it belongs to and cost of this unit. |
org.opensubsystems.core.data.DataObject |
get(int iId,
int iDomainId)
|
java.util.List |
getAvailableItems(int iItemId)
This method returnd ids of all units for specified item which are available (that is the available count > 0) |
java.util.List |
getExceptFoundHolder(int iItemId)
Get all units for specified item except the "found holder" (if any exists). |
Unit |
getFoundHolderItem(int iItemId)
Get unit which is marked as "found holder". |
org.opensubsystems.core.data.DataObject |
load(java.sql.ResultSet rsQueryResults,
int initialIndex)
|
org.opensubsystems.core.data.DataObject |
load(java.sql.ResultSet rsQueryResults,
int[] selectedColumns,
int initialIndex)
|
int |
resetCounts(int iInventoryId)
Reset all counts of all items in the inventory to 0. |
int |
save(java.util.Collection colUnits)
Update collection of Units |
org.opensubsystems.core.data.ModifiableDataObject |
save(org.opensubsystems.core.data.ModifiableDataObject data)
|
int |
setValuesForInsert(java.sql.PreparedStatement insertStatement,
org.opensubsystems.core.data.DataObject data,
int iIndex)
|
int |
setValuesForUpdate(java.sql.PreparedStatement updateStatement,
org.opensubsystems.core.data.DataObject data,
int iIndex)
|
| Methods inherited from class org.opensubsystems.patterns.listdata.persist.db.impl.ListDatabaseFactoryImpl |
|---|
get, getDefaultListDefinition, getListDatabaseSchema |
| Methods inherited from class org.opensubsystems.core.persist.db.DatabaseFactoryImpl |
|---|
getConcurrencySelectListResultSet, getDataType, getTypeSelectListResultSet |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.opensubsystems.core.persist.DataFactory |
|---|
getDataType |
| Methods inherited from interface org.opensubsystems.patterns.listdata.persist.ListFactory |
|---|
get, getDefaultListDefinition |
| Field Detail |
|---|
protected UnitDatabaseSchema m_schema
| Constructor Detail |
|---|
public UnitDatabaseFactory()
throws org.opensubsystems.core.error.OSSException
org.opensubsystems.core.error.OSSException - - an error has occured| Method Detail |
|---|
public org.opensubsystems.core.data.DataObject load(java.sql.ResultSet rsQueryResults,
int[] selectedColumns,
int initialIndex)
throws org.opensubsystems.core.error.OSSDatabaseAccessException
load in interface org.opensubsystems.patterns.listdata.persist.db.ListDatabaseFactoryorg.opensubsystems.core.error.OSSDatabaseAccessException
public int setValuesForInsert(java.sql.PreparedStatement insertStatement,
org.opensubsystems.core.data.DataObject data,
int iIndex)
throws org.opensubsystems.core.error.OSSException,
java.sql.SQLException
setValuesForInsert in interface org.opensubsystems.core.persist.db.BasicDatabaseFactoryorg.opensubsystems.core.error.OSSException
java.sql.SQLException
public int setValuesForUpdate(java.sql.PreparedStatement updateStatement,
org.opensubsystems.core.data.DataObject data,
int iIndex)
throws org.opensubsystems.core.error.OSSException,
java.sql.SQLException
setValuesForUpdate in interface org.opensubsystems.core.persist.db.ModifiableDatabaseFactoryorg.opensubsystems.core.error.OSSException
java.sql.SQLException
public org.opensubsystems.core.data.DataObject get(int iId,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
get in interface org.opensubsystems.core.persist.DataFactoryorg.opensubsystems.core.error.OSSException
public org.opensubsystems.core.data.DataObject load(java.sql.ResultSet rsQueryResults,
int initialIndex)
throws org.opensubsystems.core.error.OSSDatabaseAccessException
load in interface org.opensubsystems.core.persist.db.DatabaseFactoryorg.opensubsystems.core.error.OSSDatabaseAccessException
public org.opensubsystems.core.data.DataObject create(org.opensubsystems.core.data.DataObject data)
throws org.opensubsystems.core.error.OSSException
create in interface org.opensubsystems.core.persist.BasicDataFactoryorg.opensubsystems.core.error.OSSException
public int create(java.util.Collection colDataObject)
throws org.opensubsystems.core.error.OSSException
create in interface org.opensubsystems.core.persist.BasicDataFactoryorg.opensubsystems.core.error.OSSException
public void delete(int iId,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
delete in interface org.opensubsystems.core.persist.BasicDataFactoryorg.opensubsystems.core.error.OSSException
public org.opensubsystems.core.data.ModifiableDataObject save(org.opensubsystems.core.data.ModifiableDataObject data)
throws org.opensubsystems.core.error.OSSException
save in interface org.opensubsystems.core.persist.ModifiableDataFactoryorg.opensubsystems.core.error.OSSException
public int save(java.util.Collection colUnits)
throws org.opensubsystems.core.error.OSSException
save in interface UnitFactorycolUnits - - collection of units that have to be updated
org.opensubsystems.core.error.OSSException - - an error has occured
public Unit get(int iItemId,
double dCost)
throws org.opensubsystems.core.error.OSSException
get in interface UnitFactoryiItemId - - id of item to get unit fordCost - - cost of unit to get
org.opensubsystems.core.error.OSSException - - an error has occured
public Unit getFoundHolderItem(int iItemId)
throws org.opensubsystems.core.error.OSSException
getFoundHolderItem in interface UnitFactoryiItemId - - id of item to get found holder unit for
org.opensubsystems.core.error.OSSException - - an error has occured
public java.util.List getAvailableItems(int iItemId)
throws org.opensubsystems.core.error.OSSException
getAvailableItems in interface UnitFactoryiItemId - - item id to get the units for
org.opensubsystems.core.error.OSSException - - an error has occured
public java.util.List getExceptFoundHolder(int iItemId)
throws org.opensubsystems.core.error.OSSException
getExceptFoundHolder in interface UnitFactoryiItemId - - id of item to get units for
org.opensubsystems.core.error.OSSException - - an error has occured
public int resetCounts(int iInventoryId)
throws org.opensubsystems.core.error.OSSException
resetCounts in interface UnitFactoryiInventoryId - - inventory id where to reset count of items
org.opensubsystems.core.error.OSSException - - an error has occured
public boolean changeAvailableCount(int iUnitId,
int iValue)
throws org.opensubsystems.core.error.OSSException
changeAvailableCount in interface UnitFactoryiUnitId - - unit id to change the available count foriValue - - value to add (if positive) or remove (if negative)
org.opensubsystems.core.error.OSSException - - an error has occured
public boolean changeAvailableCount(java.util.List lstChanges)
throws org.opensubsystems.core.error.OSSException
changeAvailableCount in interface UnitFactorylstChanges - - list of TwoIntStructs where the first int is the
unit id and the second int is the integer
value (positive or negative to change the count by)
org.opensubsystems.core.error.OSSException - - an error has occured
public boolean changeShippedAndAvailableCount(int iUnitId,
int iValue)
throws org.opensubsystems.core.error.OSSException
changeShippedAndAvailableCount in interface UnitFactoryiUnitId - - unit id to change the available count foriValue - - value to add (if positive) or remove (if negative)
org.opensubsystems.core.error.OSSException - - an error has occured
public boolean changeShippedAndAvailableCountSecure(int iUnitId,
int iValue)
throws org.opensubsystems.core.error.OSSException
changeShippedAndAvailableCountSecure in interface UnitFactoryiUnitId - - Unit idiValue - - value to add ( have to be >= 0 )
org.opensubsystems.core.error.OSSException - - error in database
protected int changeAvailableCount(java.sql.PreparedStatement updateStatement,
int iUnitId,
int iValue)
throws org.opensubsystems.core.error.OSSException
updateStatement - - JDBC statement to useiUnitId - - Unit idiValue - - value to add or subtract
org.opensubsystems.core.error.OSSException - - database error
protected int changeShippedAndAvailableCount(java.sql.PreparedStatement updateStatement,
int iUnitId,
int iValue,
boolean isSecure)
throws org.opensubsystems.core.error.OSSException
updateStatement - - JDBC statement to useiUnitId - - Unit idiValue - - value to add or subtractisSecure - - if true it is called from secure variant
org.opensubsystems.core.error.OSSException - - database error
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||