org.opensubsystems.inventory.data
Class ItemUnitView

java.lang.Object
  extended by org.opensubsystems.core.data.DataObject
      extended by org.opensubsystems.core.data.BasicDataObject
          extended by org.opensubsystems.inventory.data.ItemUnitView
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ItemUnitIdentificationView

public class ItemUnitView
extends org.opensubsystems.core.data.BasicDataObject

This data object represents union of information between unit and item. Since this is a combination of these two objects and cannot be modified on its own, we will use unit data type to represent this object rather then define new data type. In this case it is critical to reuse the constants from the original objects especially for the id attribute since the combination of the data type (unit) and id (which then has to be unit id) is being used for acccess rights checking. This class is immutable since it is a view and it should be never modified.

Version:
$Id: ItemUnitView.java,v 1.9 2007/01/28 06:54:39 bastafidli Exp $
Author:
Martin Cerba
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
1.4 2006/02/21 06:01:03 bastafidli

Field Summary
static int[] ALL_FILTER_COLUMNS
          Static variable for array of all filter columns codes.
static int[] ALL_ITEM_UNIT_VIEW_COLUMNS
          Static variable for array of all columns codes.
static int COL_ITEM_UNIT_VIEW_AVAILABLE_COUNT
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_AVAILABLE_COUNT2
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_AVERAGE_COST
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_COST
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_CREATION_DATE
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_CREATION_DATE2
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_DESCRIPTION
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_DISPLAY_ORDER
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_DOMAIN_ID
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_EXPENSE_TYPE
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_FOUND_HOLDER
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_ID
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_INVENTORY_ID
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_ITEM_ID
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_LAST_RECOUNT_TIMESTAMP
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_MINIMAL_AVAILABLE_COUNT
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_MODIFICATION_DATE
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_MODIFICATION_DATE2
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_NAME
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_NAME_STEM
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_ONHOLD_COUNT
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_PERMANENTLY_ASSIGNED
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_POPULARITY_RANK
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_PRICE
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_REUSABLE
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_SHIPPED_COUNT
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_SHIPPED_COUNT2
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_SIZE
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_UNIQUELY_TRACKED
          Code for attribute.
static int COL_ITEM_UNIT_VIEW_UNIT_OF_MEASURE
          Code for attribute.
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  Item m_item
          Item object.
protected  Unit m_unit
          Unit object.
static int UNIT_BY_CATEGORY
          Code for units by category.
static java.lang.Integer UNIT_BY_CATEGORY_OBJ
          Code for units by category.
 
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
ItemUnitView()
          Empty constructor
ItemUnitView(int iUnitId, int iDomainId, int iInventoryId, int iItemId, int iShippedCount, int iAvailableCount, double dCost, boolean bFoundHolder, java.sql.Timestamp creationDate, java.sql.Timestamp modificationDate, java.lang.String strName, java.lang.String strDescription, int iUnitOfMeasure, boolean bReusable, int iExpenseType, int iAvailableCount2, int iOnHoldCount, int iPopularityRank, int iShippedCount2, boolean bUniquelyTracked, int iMinimalAvailableCount, boolean bPermanentlyAssigned, double dAverageCost, double dPrice, int iDisplayOrder, java.lang.String strNameStem, java.lang.String strSize, java.sql.Timestamp lastRecountDate, java.sql.Timestamp creationDate2, java.sql.Timestamp modificationDate2)
          Full constructor.
ItemUnitView(Item item, Unit unit)
          Constructor
ItemUnitView(ItemUnitView originalItem, Unit update)
          Kind of copy constructor.
 
Method Summary
 boolean equals(java.lang.Object oObject)
          
 java.sql.Timestamp getCreationTimestamp()
          
 int getDomainId()
          
 int getId()
          
 java.lang.Integer getIdAsObject()
          
 Item getItem()
          Return item object
 Unit getUnit()
          Return unit object
 int hashCode()
          
 boolean isSame(java.lang.Object oObject)
          
 void setCreationTimestamp(java.sql.Timestamp creationTimestamp)
          Creation timestamp is timestamp when the data object was created.
 void setId(int iNewId)
          
 
Methods inherited from class org.opensubsystems.core.data.BasicDataObject
restore
 
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

COL_ITEM_UNIT_VIEW_ID

public static final int COL_ITEM_UNIT_VIEW_ID
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_DOMAIN_ID

public static final int COL_ITEM_UNIT_VIEW_DOMAIN_ID
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_INVENTORY_ID

public static final int COL_ITEM_UNIT_VIEW_INVENTORY_ID
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_ITEM_ID

public static final int COL_ITEM_UNIT_VIEW_ITEM_ID
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_SHIPPED_COUNT

public static final int COL_ITEM_UNIT_VIEW_SHIPPED_COUNT
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_AVAILABLE_COUNT

public static final int COL_ITEM_UNIT_VIEW_AVAILABLE_COUNT
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_COST

public static final int COL_ITEM_UNIT_VIEW_COST
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_FOUND_HOLDER

public static final int COL_ITEM_UNIT_VIEW_FOUND_HOLDER
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_CREATION_DATE

public static final int COL_ITEM_UNIT_VIEW_CREATION_DATE
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_MODIFICATION_DATE

public static final int COL_ITEM_UNIT_VIEW_MODIFICATION_DATE
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_NAME

public static final int COL_ITEM_UNIT_VIEW_NAME
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_DESCRIPTION

public static final int COL_ITEM_UNIT_VIEW_DESCRIPTION
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_UNIT_OF_MEASURE

public static final int COL_ITEM_UNIT_VIEW_UNIT_OF_MEASURE
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_REUSABLE

public static final int COL_ITEM_UNIT_VIEW_REUSABLE
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_EXPENSE_TYPE

public static final int COL_ITEM_UNIT_VIEW_EXPENSE_TYPE
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_AVAILABLE_COUNT2

public static final int COL_ITEM_UNIT_VIEW_AVAILABLE_COUNT2
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_ONHOLD_COUNT

public static final int COL_ITEM_UNIT_VIEW_ONHOLD_COUNT
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_POPULARITY_RANK

public static final int COL_ITEM_UNIT_VIEW_POPULARITY_RANK
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_SHIPPED_COUNT2

public static final int COL_ITEM_UNIT_VIEW_SHIPPED_COUNT2
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_UNIQUELY_TRACKED

public static final int COL_ITEM_UNIT_VIEW_UNIQUELY_TRACKED
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_MINIMAL_AVAILABLE_COUNT

public static final int COL_ITEM_UNIT_VIEW_MINIMAL_AVAILABLE_COUNT
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_PERMANENTLY_ASSIGNED

public static final int COL_ITEM_UNIT_VIEW_PERMANENTLY_ASSIGNED
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_AVERAGE_COST

public static final int COL_ITEM_UNIT_VIEW_AVERAGE_COST
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_PRICE

public static final int COL_ITEM_UNIT_VIEW_PRICE
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_DISPLAY_ORDER

public static final int COL_ITEM_UNIT_VIEW_DISPLAY_ORDER
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_NAME_STEM

public static final int COL_ITEM_UNIT_VIEW_NAME_STEM
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_SIZE

public static final int COL_ITEM_UNIT_VIEW_SIZE
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_LAST_RECOUNT_TIMESTAMP

public static final int COL_ITEM_UNIT_VIEW_LAST_RECOUNT_TIMESTAMP
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_CREATION_DATE2

public static final int COL_ITEM_UNIT_VIEW_CREATION_DATE2
Code for attribute.

See Also:
Constant Field Values

COL_ITEM_UNIT_VIEW_MODIFICATION_DATE2

public static final int COL_ITEM_UNIT_VIEW_MODIFICATION_DATE2
Code for attribute.

See Also:
Constant Field Values

UNIT_BY_CATEGORY

public static final int UNIT_BY_CATEGORY
Code for units by category. TODO: Improve: We should aprametrize this hardcoded value based on some data type

See Also:
Constant Field Values

UNIT_BY_CATEGORY_OBJ

public static final java.lang.Integer UNIT_BY_CATEGORY_OBJ
Code for units by category.


ALL_ITEM_UNIT_VIEW_COLUMNS

public static final int[] ALL_ITEM_UNIT_VIEW_COLUMNS
Static variable for array of all columns codes. The order is important since it is used to retrieve all data from the persistence store efficiently so do not modify it unless you make changes to other places as well.


DEFAULT_LIST_COLUMNS

public static final int[] DEFAULT_LIST_COLUMNS
Default columns to retrieve when asked for list of objects.


DEFAULT_LIST_SORT_COLUMNS

public static final int[] DEFAULT_LIST_SORT_COLUMNS
Default columns to sort by when asked for list of objects. Sort first by what should be the size independent part of the name and then by the display order which should be derived from the size.


ALL_FILTER_COLUMNS

public static final int[] ALL_FILTER_COLUMNS
Static variable for array of all filter columns codes. TODO: For Miro: This is not used for now so either we implement filters for it and then remove this to do or remove this attribute. Also review if all these make sense or if we are not missing anything


DEFAULT_LIST_SORT_ORDER

public static final java.lang.String[] DEFAULT_LIST_SORT_ORDER
Default order in which the columns will be sorted.


m_item

protected Item m_item
Item object.


m_unit

protected Unit m_unit
Unit object.

Constructor Detail

ItemUnitView

public ItemUnitView()
Empty constructor


ItemUnitView

public ItemUnitView(Item item,
                    Unit unit)
Constructor

Parameters:
item - - item object
unit - - unit object

ItemUnitView

public ItemUnitView(ItemUnitView originalItem,
                    Unit update)
Kind of copy constructor. Create new object from the original and update what you can from the update.

Parameters:
originalItem - - original item
update - - update to use

ItemUnitView

public ItemUnitView(int iUnitId,
                    int iDomainId,
                    int iInventoryId,
                    int iItemId,
                    int iShippedCount,
                    int iAvailableCount,
                    double dCost,
                    boolean bFoundHolder,
                    java.sql.Timestamp creationDate,
                    java.sql.Timestamp modificationDate,
                    java.lang.String strName,
                    java.lang.String strDescription,
                    int iUnitOfMeasure,
                    boolean bReusable,
                    int iExpenseType,
                    int iAvailableCount2,
                    int iOnHoldCount,
                    int iPopularityRank,
                    int iShippedCount2,
                    boolean bUniquelyTracked,
                    int iMinimalAvailableCount,
                    boolean bPermanentlyAssigned,
                    double dAverageCost,
                    double dPrice,
                    int iDisplayOrder,
                    java.lang.String strNameStem,
                    java.lang.String strSize,
                    java.sql.Timestamp lastRecountDate,
                    java.sql.Timestamp creationDate2,
                    java.sql.Timestamp modificationDate2)
Full constructor.

Parameters:
iUnitId - - see unit object
iDomainId - - see unit object
iInventoryId - - see unit object
iItemId - - see unit object
iShippedCount - - see unit object
iAvailableCount - - see unit object
dCost - - see unit object
bFoundHolder - - see unit object
creationDate - - see unit object
modificationDate - - see unit object
strName - - see item object
strDescription - - see item object
iUnitOfMeasure - - see item object
bReusable - - see item object
iExpenseType - - see item object
iAvailableCount2 - - see item object
iOnHoldCount - - see item object
iPopularityRank - - see item object
iShippedCount2 - - see item object
bUniquelyTracked - - see item object
iMinimalAvailableCount - - see item object
bPermanentlyAssigned - - see item object
dAverageCost - - see item object
dPrice - - see item object
iDisplayOrder - - see item object
strNameStem - - see item object
strSize - - see item object
lastRecountDate - - see item object
creationDate2 - - see item object
modificationDate2 - - see item object
Method Detail

getDomainId

public int getDomainId()

Overrides:
getDomainId in class org.opensubsystems.core.data.BasicDataObject

getId

public int getId()

Overrides:
getId in class org.opensubsystems.core.data.BasicDataObject

getIdAsObject

public java.lang.Integer getIdAsObject()

Overrides:
getIdAsObject in class org.opensubsystems.core.data.BasicDataObject

setId

public void setId(int iNewId)

Overrides:
setId in class org.opensubsystems.core.data.BasicDataObject

getCreationTimestamp

public java.sql.Timestamp getCreationTimestamp()

Overrides:
getCreationTimestamp in class org.opensubsystems.core.data.BasicDataObject

setCreationTimestamp

public void setCreationTimestamp(java.sql.Timestamp creationTimestamp)
Creation timestamp is timestamp when the data object was created.

Overrides:
setCreationTimestamp in class org.opensubsystems.core.data.BasicDataObject
Parameters:
creationTimestamp - - new creation timestamp

getUnit

public Unit getUnit()
Return unit object

Returns:
Unit - unit object

getItem

public Item getItem()
Return item object

Returns:
Item - item object

equals

public boolean equals(java.lang.Object oObject)

Overrides:
equals in class org.opensubsystems.core.data.BasicDataObject

hashCode

public int hashCode()

Overrides:
hashCode in class org.opensubsystems.core.data.BasicDataObject

isSame

public boolean isSame(java.lang.Object oObject)

Specified by:
isSame in class org.opensubsystems.core.data.DataObject


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