org.opensubsystems.inventory.data
Class Identification

java.lang.Object
  extended by org.opensubsystems.core.data.DataObject
      extended by org.opensubsystems.core.data.BasicDataObject
          extended by org.opensubsystems.core.data.ModifiableDataObject
              extended by org.opensubsystems.inventory.data.Identification
All Implemented Interfaces:
java.io.Serializable

public class Identification
extends org.opensubsystems.core.data.ModifiableDataObject

Unique identification assigned to an item by manufacturer or by user. It is used to track unique items in the inventory. Units, which are unique (flag uniquely tracked in an item the unit represents) should have assigned identification which uniquely identifies them. Once unique identification is associated to an unit, it is used to track it, whenever unit is ordered, issued or returned. Identification allows two unique identifiers to be matched together, one is assigned by manufacturer (e.g. serial number) and one assigned by user (e.g. identification in user's inventory). Since majority of the items have only a single unique identifier and since majority of users have only one numbering schema for their items, we store these two numbers together. This design doesn't allow for more than 2 unique numbers per item, but it will satisfy majority of the scenarios.

Version:
$Id: Identification.java,v 1.9 2007/01/07 06:14:30 bastafidli Exp $
Author:
Miro Halas
See Also:
Serialized Form
Code reviewer:
Miro Halas
Code reviewed:
1.3 2006/02/18 05:31:32 bastafidli

Field Summary
static int[] ALL_FILTER_COLUMNS
          Static variable for array of all filter columns codes.
static int[] ALL_IDENTIFICATION_COLUMNS
          Static variable for array of all columns codes.
static int COL_IDENTIFICATION_COMMENTS
          Code for attribute.
static int COL_IDENTIFICATION_COST
          Code for attribute.
static int COL_IDENTIFICATION_CREATION_DATE
          Code for attribute.
static int COL_IDENTIFICATION_DOMAIN_ID
          Code for attribute.
static int COL_IDENTIFICATION_EXTERNAL_NUMBER
          Code for attribute.
static java.lang.Integer COL_IDENTIFICATION_EXTERNAL_NUMBER_OBJ
          Object code for table column.
static int COL_IDENTIFICATION_ID
          Code for attribute.
static int COL_IDENTIFICATION_INTERNAL_NUMBER
          Code for attribute.
static java.lang.Integer COL_IDENTIFICATION_INTERNAL_NUMBER_OBJ
          Object code for table column.
static int COL_IDENTIFICATION_INVENTORY_ID
          Code for attribute.
static int COL_IDENTIFICATION_ITEM_ID
          Code for attribute.
static int COL_IDENTIFICATION_MANUFACTURER_ID
          Code for attribute.
static int COL_IDENTIFICATION_MODIFICATION_DATE
          Code for attribute.
static int COL_IDENTIFICATION_RENTER_ID
          Code for attribute.
static int COL_IDENTIFICATION_RETIRED
          Code for attribute.
static int COL_IDENTIFICATION_UNIT_ID
          Code for attribute.
static java.lang.String DEFAULT_INTERNAL_NUMBER
          Default value for internal number
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_bRetired
          If this external number should not be used again for order or issue, then user can retire the item by setting this flag.
protected  double m_dCost
          Cost of item with identification.
protected  int m_iInventoryId
          What inventory this identification belongs to.
protected  int m_iItemId
          What item this identification represents.
protected  int m_iManufacturerId
          Since two manufacturers can use the same mechanism to generate external numbers, we need to track, who is the manufacturer, who generated this number.
protected  int m_iRenterId
          Items, which have external numbers are often rented or borrowed and we need to identify them so they can be returned later.
protected  int m_iUnitId
          What unit this identification belongs to.
protected  java.lang.String m_strComments
          Any comments about this item, for example who or when to return it to.
protected  java.lang.String m_strExternalNumber
          Unique identification for an item assigned by manufacturer.
protected  java.lang.String m_strInternalNumber
          This is inventory wide unique number assigned by user, which allows them to track uniquely their items independently from the manufacturer's external numbers.
protected static int s_iCommentsMaxLength
          Maximal length of identification comments in chars
protected static int s_iExternalNumberMaxLength
          Maximal length of identification external number in chars
protected static int s_iInternalNumberMaxLength
          Maximal length of identification internal number in chars
 
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
Identification()
          Empty constructor
Identification(int iDomainId)
          Empty identification for a specified domain initialized to default parameters.
Identification(int iId, int iDomainId, int iInventoryId, int iItemId, int iUnitId, java.lang.String strExternalNumber, int iManufacturerId, java.lang.String strInternalNumber, int iRenterId, java.lang.String strComments, boolean bRetired, double dCost, java.sql.Timestamp creationTimestamp, java.sql.Timestamp modificationTimestamp)
          Full constructor.
 
Method Summary
 java.lang.String getComments()
           
static int getCommentsMaxLengthStatic()
          Get static description max length parameter.
 double getCost()
           
 java.lang.String getExternalNumber()
           
static int getExternalNumberMaxLengthStatic()
          Get static description max length parameter.
 java.lang.String getInternalNumber()
           
static int getInternalNumberMaxLengthStatic()
          Get static description max length parameter.
 int getInventoryId()
           
 int getItemId()
           
 int getManufacturerId()
           
 int getRenterId()
           
 int getUnitId()
           
 boolean isRetired()
           
 boolean isSame(java.lang.Object oObject)
          
 void setComments(java.lang.String strComments)
           
static void setCommentsMaxLength(int iNewCommentsMaxLength)
          Set static description max length parameter.
 void setCost(double dCost)
           
 void setExternalNumber(java.lang.String strExternalNumber)
           
static void setExternalNumberMaxLength(int iNewExternalNumberMaxLength)
          Set static description max length parameter.
 void setInternalNumber(java.lang.String strInternalNumber)
           
static void setInternalNumberMaxLength(int iNewInternalNumberMaxLength)
          Set static description max length parameter.
 void setInventoryId(int iInventoryId)
           
 void setItemId(int iItemId)
           
 void setRenterId(int renterId)
           
 void setRetired(boolean bRetired)
           
 
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

COL_IDENTIFICATION_ID

public static final int COL_IDENTIFICATION_ID
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_DOMAIN_ID

public static final int COL_IDENTIFICATION_DOMAIN_ID
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_INVENTORY_ID

public static final int COL_IDENTIFICATION_INVENTORY_ID
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_ITEM_ID

public static final int COL_IDENTIFICATION_ITEM_ID
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_UNIT_ID

public static final int COL_IDENTIFICATION_UNIT_ID
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_EXTERNAL_NUMBER

public static final int COL_IDENTIFICATION_EXTERNAL_NUMBER
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_EXTERNAL_NUMBER_OBJ

public static final java.lang.Integer COL_IDENTIFICATION_EXTERNAL_NUMBER_OBJ
Object code for table column.


COL_IDENTIFICATION_MANUFACTURER_ID

public static final int COL_IDENTIFICATION_MANUFACTURER_ID
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_INTERNAL_NUMBER

public static final int COL_IDENTIFICATION_INTERNAL_NUMBER
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_INTERNAL_NUMBER_OBJ

public static final java.lang.Integer COL_IDENTIFICATION_INTERNAL_NUMBER_OBJ
Object code for table column.


COL_IDENTIFICATION_RENTER_ID

public static final int COL_IDENTIFICATION_RENTER_ID
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_COMMENTS

public static final int COL_IDENTIFICATION_COMMENTS
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_RETIRED

public static final int COL_IDENTIFICATION_RETIRED
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_COST

public static final int COL_IDENTIFICATION_COST
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_CREATION_DATE

public static final int COL_IDENTIFICATION_CREATION_DATE
Code for attribute.

See Also:
Constant Field Values

COL_IDENTIFICATION_MODIFICATION_DATE

public static final int COL_IDENTIFICATION_MODIFICATION_DATE
Code for attribute.

See Also:
Constant Field Values

DEFAULT_INTERNAL_NUMBER

public static final java.lang.String DEFAULT_INTERNAL_NUMBER
Default value for internal number

See Also:
Constant Field Values

ALL_IDENTIFICATION_COLUMNS

public static final int[] ALL_IDENTIFICATION_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.


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 it since not all columns whihc might be useful to use for filtering are included.


DEFAULT_LIST_COLUMNS

public static final int[] DEFAULT_LIST_COLUMNS
Default columns to retrieve when asked for list of objects. These should be only columns visible to user on the screen and not any internal columns. Also the columns should be retrievable efficiently so that the default view is very quick.


DEFAULT_LIST_SORT_COLUMNS

public static final int[] DEFAULT_LIST_SORT_COLUMNS
Default columns to sort by when asked for list of objects.


DEFAULT_LIST_SORT_ORDER

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


s_iExternalNumberMaxLength

protected static int s_iExternalNumberMaxLength
Maximal length of identification external number in chars


s_iInternalNumberMaxLength

protected static int s_iInternalNumberMaxLength
Maximal length of identification internal number in chars


s_iCommentsMaxLength

protected static int s_iCommentsMaxLength
Maximal length of identification comments in chars


m_iInventoryId

protected int m_iInventoryId
What inventory this identification belongs to.


m_iItemId

protected int m_iItemId
What item this identification represents.


m_iUnitId

protected int m_iUnitId
What unit this identification belongs to.


m_strExternalNumber

protected java.lang.String m_strExternalNumber
Unique identification for an item assigned by manufacturer. This is combination of characters and digits and it is only unique in combination with manufacturer. Manufacturer can also call this number something else than external number, e.g. for cell phones, it is called ESN number, for electronics it is called serial number, etc..


m_iManufacturerId

protected int m_iManufacturerId
Since two manufacturers can use the same mechanism to generate external numbers, we need to track, who is the manufacturer, who generated this number.


m_strInternalNumber

protected java.lang.String m_strInternalNumber
This is inventory wide unique number assigned by user, which allows them to track uniquely their items independently from the manufacturer's external numbers. Even though it is called number this is combination of characters and digits.


m_iRenterId

protected int m_iRenterId
Items, which have external numbers are often rented or borrowed and we need to identify them so they can be returned later. This will contain id of the company we are renting it from or DataObject.NEW_ID if not rented.


m_strComments

protected java.lang.String m_strComments
Any comments about this item, for example who or when to return it to.


m_bRetired

protected boolean m_bRetired
If this external number should not be used again for order or issue, then user can retire the item by setting this flag. Once the flag is set, the internal number won't be used anymore.


m_dCost

protected double m_dCost
Cost of item with identification. Each item with identification have cost. For item which is uniquely tracked there the cost is average of all cost values from Identification structures.

Constructor Detail

Identification

public Identification()
Empty constructor


Identification

public Identification(int iDomainId)
Empty identification for a specified domain initialized to default parameters.

Parameters:
iDomainId - - Id of the domain this identification belongs to

Identification

public Identification(int iId,
                      int iDomainId,
                      int iInventoryId,
                      int iItemId,
                      int iUnitId,
                      java.lang.String strExternalNumber,
                      int iManufacturerId,
                      java.lang.String strInternalNumber,
                      int iRenterId,
                      java.lang.String strComments,
                      boolean bRetired,
                      double dCost,
                      java.sql.Timestamp creationTimestamp,
                      java.sql.Timestamp modificationTimestamp)
Full constructor.

Parameters:
iId - - unique database generated id for this identification
iDomainId - - what domain this identification belongs to
iInventoryId - - what inventory this identification belongs to.
iItemId - - What item this external number represents. This is here to speed up searches since it has to be the same as the one in inventory id.
iUnitId - - what unit this external number belongs to.
strExternalNumber - - unique identification for an item assigned by manufacturer. This is combination of characters and digits and it is only unique in combination with manufacturer.
iManufacturerId - - since two manufacturers can use the same mechanism to generate external numbers, we need to track, who is the manufacturer, who generated this number.
strInternalNumber - - This is inventory wide unique number assigned by user which allows them to track uniquely their items independently from the manufacturer's external numbers. Even though it is called number this is combination of characters and digits.
iRenterId - - Items which have external numbers are often rented and we need to identify them so they can be later returned. This will contain ID of the company we are renting it from or DataObject.NEW_ID if not rented.
strComments - - Any comments about this item, e.g. who to return it to when rented.
bRetired - - If this external number should not be used again (for order) or issue, then user can retire the item by setting this flag.
dCost - - cost of item with this internal number
creationTimestamp - - timestamp when was the identification created
modificationTimestamp - - timestamp when was the identification last time modified.
Method Detail

getExternalNumberMaxLengthStatic

public static int getExternalNumberMaxLengthStatic()
Get static description max length parameter. It is used by database layer to adjust this parameter based on database capabilities.

Returns:
int - external number max length

setExternalNumberMaxLength

public static void setExternalNumberMaxLength(int iNewExternalNumberMaxLength)
Set static description max length parameter. It is used by database layer to adjust this parameter based on database capabilities.

Parameters:
iNewExternalNumberMaxLength - - new external number max length

getInternalNumberMaxLengthStatic

public static int getInternalNumberMaxLengthStatic()
Get static description max length parameter. It is used by database layer to adjust this parameter based on database capabilities.

Returns:
int - internal number max length

setInternalNumberMaxLength

public static void setInternalNumberMaxLength(int iNewInternalNumberMaxLength)
Set static description max length parameter. It is used by database layer to adjust this parameter based on database capabilities.

Parameters:
iNewInternalNumberMaxLength - - new internal number max length

getCommentsMaxLengthStatic

public static int getCommentsMaxLengthStatic()
Get static description max length parameter. It is used by database layer to adjust this parameter based on database capabilities.

Returns:
int - comments max length

setCommentsMaxLength

public static void setCommentsMaxLength(int iNewCommentsMaxLength)
Set static description max length parameter. It is used by database layer to adjust this parameter based on database capabilities.

Parameters:
iNewCommentsMaxLength - - new comments max length

getInventoryId

public int getInventoryId()
Returns:
int

setInventoryId

public void setInventoryId(int iInventoryId)
Parameters:
iInventoryId - - what inventory this identification belongs to

getUnitId

public int getUnitId()
Returns:
int

getItemId

public int getItemId()
Returns:
int

setItemId

public void setItemId(int iItemId)
Parameters:
iItemId - - what item this identification represents

getManufacturerId

public int getManufacturerId()
Returns:
int

getInternalNumber

public java.lang.String getInternalNumber()
Returns:
String

getExternalNumber

public java.lang.String getExternalNumber()
Returns:
String

getRenterId

public int getRenterId()
Returns:
int

getComments

public java.lang.String getComments()
Returns:
String

setRenterId

public void setRenterId(int renterId)
Parameters:
renterId - - Items, which have external numbers are often rented or borrowed and we need to identify them so they can be returned later.

setComments

public void setComments(java.lang.String strComments)
Parameters:
strComments - - Any comments about this item, for example who to return it to.

setInternalNumber

public void setInternalNumber(java.lang.String strInternalNumber)
Parameters:
strInternalNumber - - This is inventory wide unique number assigned by user, which allows them to track uniquely their items independently from the manufacturer's external numbers.

setExternalNumber

public void setExternalNumber(java.lang.String strExternalNumber)
Parameters:
strExternalNumber - - unique identification for an item assigned by manufacturer.

isRetired

public boolean isRetired()
Returns:
boolean

getCost

public double getCost()
Returns:
Returns the dCost.

setCost

public void setCost(double dCost)
Parameters:
dCost - - cost of item with item number.

setRetired

public void setRetired(boolean bRetired)
Parameters:
bRetired - - If this external number should not be used again for order or issue, then user can retire the item by setting this flag.

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.