|
|||||||||
| 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.Category
public class Category
This class represents category into which items in the inventory can be categorized. Categories are hierarchical and each category can have multiple subcategories. There are possible more implementations for manipulating hierarchical data. Description is available at: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html http://www.sitepoint.com/article/hierarchical-data-database/1 http://www.evolt.org/article/Four_ways_to_work_with_hierarchical_data/17/4047/index.html
| Field Summary | |
|---|---|
static int[] |
ALL_CATEGORY_COLUMNS
Static variable for array of all columns codes. |
static int[] |
ALL_FILTER_COLUMNS
Static variable for array of all filter columns codes. |
static int |
COL_CATEGORY_CREATION_DATE
Code for table column. |
static int |
COL_CATEGORY_DESCRIPTION
Code for table column. |
static int |
COL_CATEGORY_DISPLAY_ORDER
Code for table column. |
static int |
COL_CATEGORY_DOMAIN_ID
Code for table column. |
static int |
COL_CATEGORY_ID
Code for table column. |
static int |
COL_CATEGORY_INVENTORY_ID
Code for table column. |
static int |
COL_CATEGORY_MODIFICATION_DATE
Code for table column. |
static int |
COL_CATEGORY_NAME
Code for table column. |
static java.lang.Integer |
COL_CATEGORY_NAME_OBJ
Object code for table column. |
static int |
COL_CATEGORY_PARENT_ID
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 int |
m_iDisplayOrder
User has requirement to display categories in some particular order, such as 1 1/2", 1", 1/2", 3/4" and 3/8" should be displayed as 3/8", 1/2", 3/4", 1" and 1 1/2". |
protected int |
m_iInventoryId
Id of the inventory this category belongs to. |
protected int |
m_iParentId
Id of the parent category. |
protected java.lang.String |
m_strDescription
Description of the category. |
protected java.lang.String |
m_strName
Name of the category. |
protected static int |
s_iDescriptionMaxLength
Maximal length of category description in chars |
protected static int |
s_iNameMaxLength
Maximal length of category name 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 | |
|---|---|
Category()
Empty constructor |
|
Category(int iDomainId)
Empty category for a specified domain initialized to default parameters |
|
Category(int iCategoryId,
int iDomainId,
int iInventoryId,
int iParentId,
java.lang.String strName,
java.lang.String strDescription,
int iDisplayOrder)
Full constructor. |
|
Category(int id,
int iDomainId,
int iInventoryId,
int iParentId,
java.lang.String strName,
java.lang.String strDescription,
int iDisplayOrder,
java.sql.Timestamp creationDate,
java.sql.Timestamp modificationDate)
Full constructor to create new child category. |
|
Category(int iDomainId,
int iInventoryId,
int iParentId,
java.lang.String strName,
java.lang.String strDescription,
int iDisplayOrder)
Constructor to create new child category. |
|
Category(int iDomainId,
int iInventoryId,
java.lang.String strName,
java.lang.String strDescription,
int iDisplayOrder)
Full constructor to create new root category. |
|
| Method Summary | |
|---|---|
int |
getDescriptioMaxLength()
|
java.lang.String |
getDescription()
|
static int |
getDescriptionMaxLengthStatic()
|
int |
getDisplayOrder()
|
int |
getInventoryId()
|
java.lang.String |
getName()
|
int |
getNameMaxLength()
|
static int |
getNameMaxLengthStatic()
|
int |
getParentId()
Id of the parent. |
boolean |
isSame(java.lang.Object oObject)
|
void |
setDescription(java.lang.String strDescription)
|
static void |
setDescriptionMaxLength(int newDescriptionMaxLength)
Set static description max length parameter. |
void |
setDisplayOrder(int iDisplayOrder)
|
void |
setInventoryId(int iInventoryId)
|
void |
setName(java.lang.String strName)
|
static void |
setNameMaxLength(int newNameMaxLength)
Set static description max length parameter. |
void |
setParentId(int iParentId)
Id of the parent. |
| 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_CATEGORY_ID
public static final int COL_CATEGORY_DOMAIN_ID
public static final int COL_CATEGORY_INVENTORY_ID
public static final int COL_CATEGORY_PARENT_ID
public static final int COL_CATEGORY_NAME
public static final java.lang.Integer COL_CATEGORY_NAME_OBJ
public static final int COL_CATEGORY_DESCRIPTION
public static final int COL_CATEGORY_DISPLAY_ORDER
public static final int COL_CATEGORY_CREATION_DATE
public static final int COL_CATEGORY_MODIFICATION_DATE
public static final int[] ALL_CATEGORY_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 static int s_iNameMaxLength
protected static int s_iDescriptionMaxLength
protected int m_iInventoryId
protected int m_iParentId
protected java.lang.String m_strName
protected java.lang.String m_strDescription
protected int m_iDisplayOrder
| Constructor Detail |
|---|
public Category()
public Category(int iDomainId)
iDomainId - - Id of the domain this category belongs to
public Category(int iDomainId,
int iInventoryId,
java.lang.String strName,
java.lang.String strDescription,
int iDisplayOrder)
iDomainId - - domain idiInventoryId - - inventory idstrName - - category namestrDescription - - category descriptioniDisplayOrder - - order in which the categories should appear when
displayed in the list, if the same or 0, they will
be displayed sorted by the name
public Category(int iDomainId,
int iInventoryId,
int iParentId,
java.lang.String strName,
java.lang.String strDescription,
int iDisplayOrder)
iDomainId - - domain idiParentId - - category parent idiInventoryId - - inventory idstrName - - category namestrDescription - - category descriptioniDisplayOrder - - order in which the categories should appear when
displayed in the list, if the same or 0, they will
be displayed sorted by the name
public Category(int iCategoryId,
int iDomainId,
int iInventoryId,
int iParentId,
java.lang.String strName,
java.lang.String strDescription,
int iDisplayOrder)
iCategoryId - - category idiDomainId - - domain idiInventoryId - - inventory idiParentId - - category parent idstrName - - category namestrDescription - - category descriptioniDisplayOrder - - order in which the categories should appear when
displayed in the list, if the same or 0, they will
be displayed sorted by the name
public Category(int id,
int iDomainId,
int iInventoryId,
int iParentId,
java.lang.String strName,
java.lang.String strDescription,
int iDisplayOrder,
java.sql.Timestamp creationDate,
java.sql.Timestamp modificationDate)
id - - category idiDomainId - - domain idiInventoryId - - inventory idiParentId - - category parent idstrName - - category namestrDescription - - category descriptioniDisplayOrder - - order in which the categories should appear when
displayed in the list, if the same or 0, they will
be displayed sorted by the namecreationDate - - category creation datemodificationDate - - category modification date| Method Detail |
|---|
public static void setNameMaxLength(int newNameMaxLength)
newNameMaxLength - - new name max lengthpublic static void setDescriptionMaxLength(int newDescriptionMaxLength)
newDescriptionMaxLength - - new description max lengthpublic int getNameMaxLength()
public static int getNameMaxLengthStatic()
public int getDescriptioMaxLength()
public static int getDescriptionMaxLengthStatic()
public java.lang.String getName()
public void setName(java.lang.String strName)
strName - - new name to setpublic java.lang.String getDescription()
public void setDescription(java.lang.String strDescription)
strDescription - - new description to setpublic int getParentId()
public void setParentId(int iParentId)
iParentId - - if this is DataObject.NEW_ID then this is root categorypublic int getInventoryId()
public void setInventoryId(int iInventoryId)
iInventoryId - - Id of inventory where this category belongspublic int getDisplayOrder()
public void setDisplayOrder(int iDisplayOrder)
iDisplayOrder - - integer value used to sort categories for displaypublic 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 | ||||||||