|
|||||||||
| 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.ItemDatabaseFactory
public class ItemDatabaseFactory
Data factory to retrieve and manipulate item types in persistence store.
| Field Summary | |
|---|---|
protected ItemDatabaseSchema |
m_schema
Schema to use to execute database dependent operations. |
protected CategoryDatabaseSchema |
m_schemaCategory
Schema to use to execute database dependent operations for categories. |
| 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 | |
|---|---|
ItemDatabaseFactory()
Default constructor. |
|
| Method Summary | |
|---|---|
boolean |
addToCategories(int iItemId,
int[] arrCategoryIds)
Add item type to a specified categories. |
boolean |
addToCategory(int iItem,
int iCategory)
Add item type to a specified category. |
void |
changeAvailableCount(int iItemId,
int iAvailableCountChange,
int iDomainId)
Change the available count for specified items by specified relative values. |
boolean |
changeAvailableCount(java.util.List lstChanges,
int iDomainId)
Change the available count for specified items by specified relative values. |
protected int |
changeAvailableCount(java.sql.PreparedStatement updateStatement,
int iItemId,
int iAvailableCountChange)
Change the available count for specified inventory items by specified relative values. |
void |
changeCounts(int iItemTypeId,
int iAvailableCountChange,
int iOnHoldCountChange,
int iDomainId)
Update the on hold cont and available count for specified item. |
void |
changeCounts(java.util.List lstChanges,
int iDomainId)
Update the on hold cont and available count for specified item. |
protected void |
changeCounts(java.sql.PreparedStatement updateStatement,
int iItemId,
int iAvailableCountChange,
int iOnHoldCountChange,
int iDomaindId)
Update the on hold cont and available count for specified item. |
void |
changeOnHoldCount(int iItemTypeId,
int iOnHoldCountChange,
boolean bOnlyIfAvailable,
int iDomainId)
Update the on hold count for specified item by specified relative values. |
void |
changeOnHoldCount(java.util.List lstChanges,
boolean bOnlyIfAvailable,
int iDomainId)
Update the on hold count for specified item, which means that the item is still in the inventory but it was reserved. |
protected int |
changeOnHoldCount(java.sql.PreparedStatement updateStatement,
int iItemId,
int iOnHoldCountChange,
boolean bOnlyIfAvailable)
Update the on hold count for specified item, which means that the item is still in the inventory but it was reserved. |
boolean |
changeShippedAndAvailableCount(int iItemId,
int iAvailableCountChange,
int iDomainId)
Update the shipped and available count for specified item. |
boolean |
changeShippedAndAvailableCount(java.util.List lstChanges)
Update the shipped and available count for specified item. |
protected int |
changeShippedAndAvailableCount(java.sql.PreparedStatement updateStatement,
int iItemId,
int iAvailableCountChange,
boolean isSecure)
Change the shipped and available count for specified inventory items by specified relative values. |
boolean |
changeShippedAndAvailableCountSafely(java.util.List lstChanges)
Update the shipped and available count for specified item. |
protected void |
checkAvailableChangeError(int iItemId,
int iUpdateCount,
int iDomainId)
Check what type of error has occured during update of available count. |
protected void |
checkOnHoldChangeError(int iItemId,
int iOnHoldCountChange,
int iUpdateCount,
int iDomainId)
Check what type of error has occured during update of on hold count. |
int |
create(java.util.Collection colDataObject)
|
org.opensubsystems.core.data.DataObject |
create(org.opensubsystems.core.data.DataObject data)
|
void |
delete(int iId,
int iDomainId)
|
org.opensubsystems.core.data.DataObject |
get(int iId,
int iDomainId)
|
Item |
get(int iInventoryId,
java.lang.String strItemName)
Get item based on it's inventory id and name. |
int[] |
getAllEmptyCategories(int iInventoryId,
int[] arrIds)
Get IDs for all empty categories belonging to the specified inventory. |
org.opensubsystems.core.util.TwoIntStruct[] |
getCategories(long time,
int iInventoryId)
Return all mapping between items and categories that's changed since the specified time. |
java.util.List |
getIdsInCategory(int iRootCategoryId)
Get ids of all items for category with id TODO: For Miro: Figure out what this method means? Will it return items from all subcategories or just the one specified? Should we call this main or root? |
int |
getMainCategoryId(int iItemId)
Get id of item type main category. |
java.util.List |
getSubcategoryIds(int iItemId)
Get id of ite type main category TODO: For Miro: Figure out what this method means? Item type should be able to be at multiple level of subcategories. |
protected int |
insertItemCategories(java.sql.Connection cntConnection,
int iItemId,
int[] arrCategoryIds)
Assign new categories to item. |
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)
|
void |
removeFromAllCategories(int iItemId)
Remove specified item for all categories |
int |
resetCounts(int iInventoryId)
Reset all counts of all items in the inventory to 0. |
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 ItemDatabaseSchema m_schema
protected CategoryDatabaseSchema m_schemaCategory
| Constructor Detail |
|---|
public ItemDatabaseFactory()
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 Item get(int iInventoryId,
java.lang.String strItemName)
throws org.opensubsystems.core.error.OSSException
get in interface ItemFactoryiInventoryId - - id of the inventory from where to get the ItemstrItemName - - name of the Item to get
org.opensubsystems.core.error.OSSException - - an error has occured
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 org.opensubsystems.core.util.TwoIntStruct[] getCategories(long time,
int iInventoryId)
throws org.opensubsystems.core.error.OSSException
getCategories in interface ItemFactorytime - - Number of seconds since January 1, 1970, 00:00:00 GMT.
If zero, then return ALL item inventory category mappings.iInventoryId - - id of inventory to get the categories for
org.opensubsystems.core.error.OSSException - - an error has occured
public boolean addToCategory(int iItem,
int iCategory)
throws org.opensubsystems.core.error.OSSException
addToCategory in interface ItemFactoryiItem - - id of item to add to categoryiCategory - - id of cateogry to add the item type to
org.opensubsystems.core.error.OSSException - - an error has occured
public boolean addToCategories(int iItemId,
int[] arrCategoryIds)
throws org.opensubsystems.core.error.OSSException
addToCategories in interface ItemFactoryiItemId - - id of item to add to categoriesarrCategoryIds - - array of category ids where to add the item
org.opensubsystems.core.error.OSSException - - an error has occured
public int resetCounts(int iInventoryId)
throws org.opensubsystems.core.error.OSSException
resetCounts in interface ItemFactoryiInventoryId - - inventory id where to reset count of items
org.opensubsystems.core.error.OSSException - - an error has occured
public void removeFromAllCategories(int iItemId)
throws org.opensubsystems.core.error.OSSException
removeFromAllCategories in interface ItemFactoryiItemId - - Item id
org.opensubsystems.core.error.OSSException - - an error has occured
public void changeCounts(int iItemTypeId,
int iAvailableCountChange,
int iOnHoldCountChange,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
changeCounts in interface ItemFactoryiItemTypeId - - id of the ItemiAvailableCountChange - - value to increment or decrement the
available count byiOnHoldCountChange - - value to increment or decrement the on hold
count byiDomainId - - id of domain in which the item is supposed to exist
org.opensubsystems.core.error.OSSException - - an error has occured
public void changeCounts(java.util.List lstChanges,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
changeCounts in interface ItemFactorylstChanges - - list of ThreeIntStructs where the first int is the
item id, second is the relative available count change
and third is relative onhold count change.iDomainId - - id of domain in which the items are supposed to exist
org.opensubsystems.core.error.OSSException - - an error has occured
public void changeOnHoldCount(int iItemTypeId,
int iOnHoldCountChange,
boolean bOnlyIfAvailable,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
changeOnHoldCount in interface ItemFactoryiItemTypeId - - id of the ItemiOnHoldCountChange - - increment (positive) or decrement (negative)
valuebOnlyIfAvailable - - if true then the on hold count will be updated
only if available that is
(item count - already on hold item count
>= the new on hold item count)
(that means there are some items which are
available which were not reserved yet)iDomainId - - id of domain in which the item is supposed to exist
org.opensubsystems.core.error.OSSException - - an error has occured
public void changeOnHoldCount(java.util.List lstChanges,
boolean bOnlyIfAvailable,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
changeOnHoldCount in interface ItemFactorylstChanges - - list of TwoIntStructs where the first int is
the item id and the second int is the integer
value (positive or negative) to change the count bybOnlyIfAvailable - - if true then the on hold count will be updated
only if available that is
(item count - already on hold item count
>= the new on hold item count)
(that means there are some items which are
available which were not reserved yet)iDomainId - - id of domain in which the items are supposed to exist
org.opensubsystems.core.error.OSSException - - an error has occured
public void changeAvailableCount(int iItemId,
int iAvailableCountChange,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
changeAvailableCount in interface ItemFactoryiItemId - - id of the ItemiAvailableCountChange - - value to increment or decrement available
count byiDomainId - - id of domain in which the item is supposed to exist
org.opensubsystems.core.error.OSSException - - an error has occured
public boolean changeAvailableCount(java.util.List lstChanges,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
changeAvailableCount in interface ItemFactorylstChanges - - list of TwoIntStructs where the first int is the item
id and the second int is the integer value (positive
or negative) to change the count byiDomainId - - id of domain in which the items are supposed to exist
org.opensubsystems.core.error.OSSException - - an error has occured
public boolean changeShippedAndAvailableCount(int iItemId,
int iAvailableCountChange,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
changeShippedAndAvailableCount in interface ItemFactoryiItemId - - id of the ItemiAvailableCountChange - - value to increment or decrement the shipped
and available count byiDomainId - - id of domain in which the item is supposed to exist
org.opensubsystems.core.error.OSSException - - an error has occured
public boolean changeShippedAndAvailableCount(java.util.List lstChanges)
throws org.opensubsystems.core.error.OSSException
changeShippedAndAvailableCount in interface ItemFactorylstChanges - - list of TwoIntStructs where the first int is the item
id and the second int is the integer shipped and
available count value (positiveor negative) to change
the count by
org.opensubsystems.core.error.OSSException - - an error has occured
public boolean changeShippedAndAvailableCountSafely(java.util.List lstChanges)
throws org.opensubsystems.core.error.OSSException
changeShippedAndAvailableCountSafely in interface ItemFactorylstChanges - - list of TwoIntStructs where the first int is the item
id and the second int is the integer shipped and
available count value (positive or negative) to change
the count by
org.opensubsystems.core.error.OSSException - - an error has occured
public int getMainCategoryId(int iItemId)
throws org.opensubsystems.core.error.OSSException
getMainCategoryId in interface ItemFactoryiItemId - - Item id
org.opensubsystems.core.error.OSSException - - an error has occured
public java.util.List getSubcategoryIds(int iItemId)
throws org.opensubsystems.core.error.OSSException
getSubcategoryIds in interface ItemFactoryiItemId - - item id
org.opensubsystems.core.error.OSSException - - an error has occured
public java.util.List getIdsInCategory(int iRootCategoryId)
throws org.opensubsystems.core.error.OSSException
getIdsInCategory in interface ItemFactoryiRootCategoryId - - id of root category
org.opensubsystems.core.error.OSSException - - an error has occured
public int[] getAllEmptyCategories(int iInventoryId,
int[] arrIds)
throws org.opensubsystems.core.error.OSSException
getAllEmptyCategories in interface ItemFactoryiInventoryId - - inventory to find empty categories inarrIds - - array of category IDs to delete, can be null to get all
empty categories
org.opensubsystems.core.error.OSSException - - an error has occured
protected void changeCounts(java.sql.PreparedStatement updateStatement,
int iItemId,
int iAvailableCountChange,
int iOnHoldCountChange,
int iDomaindId)
throws org.opensubsystems.core.error.OSSException
updateStatement - - PreparedStatement with sqliItemId - - ID of the ItemiAvailableCountChange - - increment or decrement valueiOnHoldCountChange - - increment or decrement valueiDomaindId - - id of domain in which the item is supposed to exist
org.opensubsystems.core.error.OSSException - - error message
protected int changeOnHoldCount(java.sql.PreparedStatement updateStatement,
int iItemId,
int iOnHoldCountChange,
boolean bOnlyIfAvailable)
throws org.opensubsystems.core.error.OSSException
updateStatement - - JDBC statement to useiItemId - - item idiOnHoldCountChange - - value to add or subtractbOnlyIfAvailable - - if true then the on hold count will be updated
only if available item count - already on hold item
count >= then new on hold item count (that means
there are some items which are available which
were not reserved yet)
org.opensubsystems.core.error.OSSException - - database error
protected void checkOnHoldChangeError(int iItemId,
int iOnHoldCountChange,
int iUpdateCount,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
iItemId - - item during update of which an error has occurediOnHoldCountChange - - what should have been the new on hold countiUpdateCount - - how many database lines were updatediDomaindId - - id of domain in which the item is supposed to exist
org.opensubsystems.core.error.OSSException - - correct error describing what has happened
protected int changeAvailableCount(java.sql.PreparedStatement updateStatement,
int iItemId,
int iAvailableCountChange)
throws org.opensubsystems.core.error.OSSException
updateStatement - - JDBC statement to useiItemId - - item idiAvailableCountChange - - value to add or subtract
org.opensubsystems.core.error.OSSException - - database error
protected void checkAvailableChangeError(int iItemId,
int iUpdateCount,
int iDomainId)
throws org.opensubsystems.core.error.OSSException
iItemId - - item during update of which an error has occurediUpdateCount - - how many database lines were updatediDomaindId - - id of domain in which the item is supposed to exist
org.opensubsystems.core.error.OSSException - - correct error describing what has happened
protected int changeShippedAndAvailableCount(java.sql.PreparedStatement updateStatement,
int iItemId,
int iAvailableCountChange,
boolean isSecure)
throws org.opensubsystems.core.error.OSSException
updateStatement - - JDBC statement to useiItemId - - item idiAvailableCountChange - - value to add or subtractisSecure - - use "secure" variant of sql statement
org.opensubsystems.core.error.OSSException - - database error
protected int insertItemCategories(java.sql.Connection cntConnection,
int iItemId,
int[] arrCategoryIds)
throws org.opensubsystems.core.error.OSSException
cntConnection - - connection to useiItemId - - ID of the itemarrCategoryIds - - array of category IDs
org.opensubsystems.core.error.OSSException - - error during insert
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||