|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.opensubsystems.core.data.DataObject
org.opensubsystems.core.data.BasicDataObject
org.opensubsystems.core.data.ModifiableDataObject
org.opensubsystems.inventory.data.Unit
public class Unit
Unit represents group of items of the same type with certain cost which are present in the inventory. All items of the same type with the same cost share the same record. This allows us to track group of items which may have been added to the inventory at different times and therefore can have different cost but otherwise they the same items.
| Field Summary | |
|---|---|
static int[] |
ALL_FILTER_COLUMNS
Static variable for array of all filter columns codes. |
static int[] |
ALL_UNIT_COLUMNS
Static variable for array of all columns codes. |
static int |
COL_UNIT_AVAILABLE_COUNT
Code for table column. |
static int |
COL_UNIT_COST
Code for table column. |
static java.lang.Integer |
COL_UNIT_COST_OBJ
Code for table column. |
static int |
COL_UNIT_CREATION_DATE
Code for table column. |
static int |
COL_UNIT_DOMAIN_ID
Code for table column. |
static int |
COL_UNIT_FOUND_HOLDER
Code for table column. |
static int |
COL_UNIT_ID
Code for table column. |
static int |
COL_UNIT_INVENTORY_ID
Code for table column. |
static int |
COL_UNIT_ITEM_ID
Code for table column. |
static int |
COL_UNIT_MODIFICATION_DATE
Code for table column. |
static int |
COL_UNIT_SHIPPED_COUNT
Code for table column. |
static int[] |
DEFAULT_LIST_COLUMNS
Default columns to retrieve when asked for list of objects. |
static int[] |
DEFAULT_LIST_SORT_COLUMNS
Default columns to sort by when asked for list of objects. |
static java.lang.String[] |
DEFAULT_LIST_SORT_ORDER
Default order in which the columns will be sorted. |
protected boolean |
m_bFoundHolder
If this is true then this instance is used to track found units we don't know where they came from or what instance of unit for this item they belong to. |
protected double |
m_dCost
Cost of individual unit. |
protected int |
m_iAvailableCount
This has to be nonnegative number less or equal to shipped count for all units except for unit flagged as the "found holder" since for all normal units we cannot issue more than we have available. |
protected int |
m_iInventoryId
ID of the inventory the unit belongs to. |
protected int |
m_iItemId
Id of the item represented by this unit |
protected int |
m_iShippedCount
How many units were shipped (delivered) to the inventory. |
| Fields inherited from class org.opensubsystems.core.data.ModifiableDataObject |
|---|
m_modificationTimestamp |
| Fields inherited from class org.opensubsystems.core.data.BasicDataObject |
|---|
m_creationTimestamp, m_iDomainId |
| Fields inherited from class org.opensubsystems.core.data.DataObject |
|---|
NEW_ID, NEW_ID_OBJ, NEW_ID_STR |
| Constructor Summary | |
|---|---|
Unit(int iDomainId)
Empty constructor |
|
Unit(int iDomainId,
int iInventoryId,
int iItemId,
int iShippedCount,
int iAvailableCount,
double dCost,
boolean bFoundHolder)
Full constructor to create new unit |
|
Unit(int iUnitId,
int iDomainId,
int iInventoryId,
int iItemId,
int iShippedCount,
int iAvailableCount,
double dCost,
boolean bFoundHolder,
java.sql.Timestamp creationDate,
java.sql.Timestamp modificationDate)
Full constructor to create new unit. |
|
| Method Summary | |
|---|---|
int |
getAvailableCount()
|
double |
getCost()
|
int |
getInventoryId()
|
int |
getItemId()
|
int |
getShippedCount()
|
boolean |
isFoundHolder()
|
boolean |
isSame(java.lang.Object oObject)
|
void |
setAvailableCount(int value)
Change available count. |
void |
setCost(double dCost)
|
void |
setInventoryId(int iInventoryId)
|
void |
setItemId(int iItemId)
|
void |
setShippedCount(int iShippedCount)
|
| Methods inherited from class org.opensubsystems.core.data.ModifiableDataObject |
|---|
equals, getModificationTimestamp, hashCode, restore, setModificationTimestamp |
| Methods inherited from class org.opensubsystems.core.data.BasicDataObject |
|---|
getCreationTimestamp, getDomainId, getId, getIdAsObject, restore, setCreationTimestamp, setId |
| Methods inherited from class org.opensubsystems.core.data.DataObject |
|---|
isFromPersistenceStore, setFromPersistenceStore |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int COL_UNIT_ID
public static final int COL_UNIT_DOMAIN_ID
public static final int COL_UNIT_INVENTORY_ID
public static final int COL_UNIT_ITEM_ID
public static final int COL_UNIT_SHIPPED_COUNT
public static final int COL_UNIT_AVAILABLE_COUNT
public static final int COL_UNIT_COST
public static final java.lang.Integer COL_UNIT_COST_OBJ
public static final int COL_UNIT_FOUND_HOLDER
public static final int COL_UNIT_CREATION_DATE
public static final int COL_UNIT_MODIFICATION_DATE
public static final int[] ALL_UNIT_COLUMNS
public static final int[] ALL_FILTER_COLUMNS
public static final int[] DEFAULT_LIST_COLUMNS
public static final int[] DEFAULT_LIST_SORT_COLUMNS
public static final java.lang.String[] DEFAULT_LIST_SORT_ORDER
protected int m_iInventoryId
protected int m_iItemId
protected int m_iShippedCount
protected int m_iAvailableCount
protected double m_dCost
protected boolean m_bFoundHolder
| Constructor Detail |
|---|
public Unit(int iDomainId)
iDomainId - - domain id this unit belongs to
public Unit(int iDomainId,
int iInventoryId,
int iItemId,
int iShippedCount,
int iAvailableCount,
double dCost,
boolean bFoundHolder)
iDomainId - - domain id this unit belongs toiInventoryId - - id of inventory this unit belongs toiItemId - - id of the item this unit representsiShippedCount - - originally shipped count, how many units were
supplied to the inventory with a given costiAvailableCount - - available count - how many units are available in
the inventorydCost - - cost of the unitbFoundHolder - - If this is true then this instance is used to track
found units we don't know where they came from or
what instance of unit for this item they belong to.
There could be only one such found holder for an
item. If this is false then this is just a regular
unit which was supplied to the inventory. Found
holder unit is also used when we are issuing more
units than we have available, since apparently in
the inventory there were some units "found" (units
we don't know anything about).
public Unit(int iUnitId,
int iDomainId,
int iInventoryId,
int iItemId,
int iShippedCount,
int iAvailableCount,
double dCost,
boolean bFoundHolder,
java.sql.Timestamp creationDate,
java.sql.Timestamp modificationDate)
iUnitId - - id of this unitiDomainId - - domain id this unit belongs toiInventoryId - - id of inventory this unit belongs toiItemId - - id of the item this unit representsiShippedCount - - originally shipped count, how many units were
supplied to the inventory with a given costiAvailableCount - - available count - how many units are available in
the inventorydCost - - cost of the unitsbFoundHolder - - If this is true then this instance is used to track
found units we don't know where they came from or
what instance of unit for this item they belong to.
There could be only one such found holder for an
item. If this is false then this is just a regular
unit which was supplied to the inventory. Found
holder unit is also used when we are issuing more
units than we have available, since apparently in
the inventory there were some units "found" (units
we don't know anything about).modificationDate - - Unit modification datecreationDate - - Unit creation date| Method Detail |
|---|
public int getItemId()
public void setItemId(int iItemId)
iItemId - - what item this identification representspublic int getAvailableCount()
public double getCost()
public int getInventoryId()
public void setInventoryId(int iInventoryId)
iInventoryId - - what inventory this unit belongs topublic void setAvailableCount(int value)
value - - new available count valuepublic boolean isFoundHolder()
public int getShippedCount()
public void setShippedCount(int iShippedCount)
iShippedCount - - originally shipped count, how many units were
supplied to the inventory with a given costpublic void setCost(double dCost)
dCost - - Cost of individual item. Combination of item and cost
should be unique. Average cost is cached in the Item.public boolean isSame(java.lang.Object oObject)
isSame in class org.opensubsystems.core.data.DataObject
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||