org.tigris.scarab.om
Class AttributeOption
java.lang.Object
org.apache.torque.om.BaseObject
org.tigris.scarab.om.BaseAttributeOption
org.tigris.scarab.om.AttributeOption
- All Implemented Interfaces:
- org.apache.torque.om.Persistent, org.apache.fulcrum.intake.Retrievable, java.io.Serializable
- public class AttributeOption
- extends BaseAttributeOption
- implements org.apache.torque.om.Persistent
This class deals with AttributeOptions. For more details
about the implementation of this class, read the documentation
about how Scarab manages Attributes.
The implementation of this class is "smart" in that it will only
touch the database when it absolutely needs to. For example, if
you create a new AttributeOption, it will not query the database
for the parent/child relationships until you ask it to. It will then
cache the information locally.
All instances of AttributeOptions are cached using the
TurbineGlobalCache service.
- Version:
- $Id: AttributeOption.java 9977 2005-12-09 00:40:59Z hair $
- Author:
- Jon S. Stevens
- See Also:
- Serialized Form
| Fields inherited from class org.tigris.scarab.om.BaseAttributeOption |
collActivitysRelatedByNewOptionId, collActivitysRelatedByOldOptionId, collAttributes, collAttributeValues, collConditions, collRIssueTypeOptions, collRModuleOptions, collROptionOptionsRelatedByOption1Id, collROptionOptionsRelatedByOption2Id, collTransitionsRelatedByFromOptionId, collTransitionsRelatedByToOptionId |
| Fields inherited from class org.apache.torque.om.BaseObject |
NEW_ID |
|
Method Summary |
void |
deleteIssueTypeMappings()
Delete mappings with global issue types. |
void |
deleteModuleMappings()
Delete mappings with all modules and issue types. |
java.util.List |
getAncestors()
Returns a list of AttributeOptions which are ancestors
of this AttributeOption. |
Attribute |
getAttribute()
Get the Attribute associated with this Option |
(package private) static java.lang.String |
getCacheKey(org.apache.torque.om.ObjectKey key)
Creates a key for use in caching AttributeOptions |
java.util.List |
getChildren()
Returns a list of AttributeOption's which are children
of this AttributeOption. |
static java.util.Comparator |
getComparator()
Compares numeric value and in cases where the numeric value
is the same it compares the display values. |
java.util.List |
getDescendants()
Returns a list of AttributeOptions which are descendants
of this AttributeOption. |
AttributeOption |
getParent()
Returns direct parent of this child. |
java.util.List |
getParents()
Returns a list of AttributeOption's which are parents
of this AttributeOption. |
static java.lang.Integer |
getStatusClosedPK()
|
boolean |
hasChildren()
Does this AttributeOption have children? |
boolean |
hasParents()
Does this AttributeOption have parents? |
boolean |
isChildOf(AttributeOption parent)
Checks to see if this Attribute option is a child of
the passed in AttributeOption parent. |
boolean |
isParentOf(AttributeOption child)
Checks to see if this Attribute option is a parent of
the passed in AttributeOption child. |
boolean |
isSystemDefined()
Checks if this attribute option is associated with atleast one of the
global issue types that is system defined. |
void |
setAttribute(Attribute v)
Set the Attribute associated with this Option |
void |
sortChildren()
re-sorts the children |
void |
sortParents()
re-sorts the Parents |
java.lang.String |
toString()
A String representation of this object. |
| Methods inherited from class org.tigris.scarab.om.BaseAttributeOption |
addActivityRelatedByNewOptionId, addActivityRelatedByOldOptionId, addAttribute, addAttributeValue, addCondition, addRIssueTypeOption, addRModuleOption, addROptionOptionRelatedByOption1Id, addROptionOptionRelatedByOption2Id, addTransitionRelatedByFromOptionId, addTransitionRelatedByToOptionId, copy, copyInto, getActivitysRelatedByNewOptionId, getActivitysRelatedByNewOptionId, getActivitysRelatedByNewOptionId, getActivitysRelatedByNewOptionId, getActivitysRelatedByNewOptionIdJoinActivitySet, getActivitysRelatedByNewOptionIdJoinAttachment, getActivitysRelatedByNewOptionIdJoinAttribute, getActivitysRelatedByNewOptionIdJoinAttributeOptionRelatedByOldOptionId, getActivitysRelatedByNewOptionIdJoinDepend, getActivitysRelatedByNewOptionIdJoinIssue, getActivitysRelatedByNewOptionIdJoinScarabUserImplRelatedByNewUserId, getActivitysRelatedByNewOptionIdJoinScarabUserImplRelatedByOldUserId, getActivitysRelatedByOldOptionId, getActivitysRelatedByOldOptionId, getActivitysRelatedByOldOptionId, getActivitysRelatedByOldOptionId, getActivitysRelatedByOldOptionIdJoinActivitySet, getActivitysRelatedByOldOptionIdJoinAttachment, getActivitysRelatedByOldOptionIdJoinAttribute, getActivitysRelatedByOldOptionIdJoinAttributeOptionRelatedByNewOptionId, getActivitysRelatedByOldOptionIdJoinDepend, getActivitysRelatedByOldOptionIdJoinIssue, getActivitysRelatedByOldOptionIdJoinScarabUserImplRelatedByNewUserId, getActivitysRelatedByOldOptionIdJoinScarabUserImplRelatedByOldUserId, getAttribute, getAttributeId, getAttributes, getAttributes, getAttributes, getAttributes, getAttributesJoinAttributeOption, getAttributesJoinAttributeType, getAttributesJoinScarabUserImpl, getAttributeValues, getAttributeValues, getAttributeValues, getAttributeValues, getAttributeValuesJoinAttribute, getAttributeValuesJoinAttributeOption, getAttributeValuesJoinIssue, getAttributeValuesJoinScarabUserImpl, getByName, getByPeerName, getByPosition, getConditions, getConditions, getConditions, getConditions, getConditionsJoinAttribute, getConditionsJoinAttributeOption, getConditionsJoinRModuleAttribute, getConditionsJoinRModuleIssueType, getConditionsJoinTransition, getDeleted, getFieldNames, getName, getOptionId, getPeer, getPrimaryKey, getQueryKey, getRIssueTypeOptions, getRIssueTypeOptions, getRIssueTypeOptions, getRIssueTypeOptions, getRIssueTypeOptionsJoinAttributeOption, getRIssueTypeOptionsJoinIssueType, getRModuleOptions, getRModuleOptions, getRModuleOptions, getRModuleOptions, getRModuleOptionsJoinAttributeOption, getRModuleOptionsJoinIssueType, getRModuleOptionsJoinScarabModule, getROptionOptionsRelatedByOption1Id, getROptionOptionsRelatedByOption1Id, getROptionOptionsRelatedByOption1Id, getROptionOptionsRelatedByOption1Id, getROptionOptionsRelatedByOption1IdJoinAttributeOptionRelatedByOption2Id, getROptionOptionsRelatedByOption1IdJoinOptionRelationship, getROptionOptionsRelatedByOption2Id, getROptionOptionsRelatedByOption2Id, getROptionOptionsRelatedByOption2Id, getROptionOptionsRelatedByOption2Id, getROptionOptionsRelatedByOption2IdJoinAttributeOptionRelatedByOption1Id, getROptionOptionsRelatedByOption2IdJoinOptionRelationship, getTransitionsRelatedByFromOptionId, getTransitionsRelatedByFromOptionId, getTransitionsRelatedByFromOptionId, getTransitionsRelatedByFromOptionId, getTransitionsRelatedByFromOptionIdJoinAttribute, getTransitionsRelatedByFromOptionIdJoinAttributeOptionRelatedByToOptionId, getTransitionsRelatedByToOptionId, getTransitionsRelatedByToOptionId, getTransitionsRelatedByToOptionId, getTransitionsRelatedByToOptionId, getTransitionsRelatedByToOptionIdJoinAttribute, getTransitionsRelatedByToOptionIdJoinAttributeOptionRelatedByFromOptionId, initActivitysRelatedByNewOptionId, initActivitysRelatedByOldOptionId, initAttributes, initAttributeValues, initConditions, initRIssueTypeOptions, initRModuleOptions, initROptionOptionsRelatedByOption1Id, initROptionOptionsRelatedByOption2Id, initTransitionsRelatedByFromOptionId, initTransitionsRelatedByToOptionId, isCacheOnSave, save, save, save, setAttributeId, setAttributeKey, setDeleted, setName, setOptionId, setPrimaryKey, setPrimaryKey, setQueryKey |
| Methods inherited from class org.apache.torque.om.BaseObject |
equals, equals, getLog, hashCode, isModified, isNew, resetModified, setModified, setNew, setPrimaryKey |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.apache.torque.om.Persistent |
getPrimaryKey, isModified, isNew, save, save, save, setModified, setNew, setPrimaryKey, setPrimaryKey |
AttributeOption
protected AttributeOption()
- Must call getInstance()
getStatusClosedPK
public static java.lang.Integer getStatusClosedPK()
getCacheKey
static java.lang.String getCacheKey(org.apache.torque.om.ObjectKey key)
- Creates a key for use in caching AttributeOptions
getComparator
public static java.util.Comparator getComparator()
- Compares numeric value and in cases where the numeric value
is the same it compares the display values.
getAttribute
public Attribute getAttribute()
throws org.apache.torque.TorqueException
- Get the Attribute associated with this Option
- Overrides:
getAttribute in class BaseAttributeOption
- Returns:
- the associated Attribute object
- Throws:
org.apache.torque.TorqueException
setAttribute
public void setAttribute(Attribute v)
throws org.apache.torque.TorqueException
- Set the Attribute associated with this Option
- Overrides:
setAttribute in class BaseAttributeOption
- Parameters:
v - Attribute
- Throws:
org.apache.torque.TorqueException
getAncestors
public java.util.List getAncestors()
throws org.apache.torque.TorqueException
- Returns a list of AttributeOptions which are ancestors
of this AttributeOption. An Ancestor is the parent tree
going up from this AO. The order is bottom up.
- Throws:
org.apache.torque.TorqueException
getDescendants
public java.util.List getDescendants()
throws org.apache.torque.TorqueException
- Returns a list of AttributeOptions which are descendants
of this AttributeOption. The descendants is the child tree
going down from this AO. The order is bottom up.
- Throws:
org.apache.torque.TorqueException
getChildren
public java.util.List getChildren()
throws org.apache.torque.TorqueException
- Returns a list of AttributeOption's which are children
of this AttributeOption.
- Throws:
org.apache.torque.TorqueException
getParents
public java.util.List getParents()
throws org.apache.torque.TorqueException
- Returns a list of AttributeOption's which are parents
of this AttributeOption.
- Throws:
org.apache.torque.TorqueException
sortParents
public void sortParents()
- re-sorts the Parents
sortChildren
public void sortChildren()
- re-sorts the children
isChildOf
public boolean isChildOf(AttributeOption parent)
throws org.apache.torque.TorqueException
- Checks to see if this Attribute option is a child of
the passed in AttributeOption parent.
- Throws:
org.apache.torque.TorqueException
isParentOf
public boolean isParentOf(AttributeOption child)
throws org.apache.torque.TorqueException
- Checks to see if this Attribute option is a parent of
the passed in AttributeOption child.
- Throws:
org.apache.torque.TorqueException
hasChildren
public boolean hasChildren()
throws org.apache.torque.TorqueException
- Does this AttributeOption have children?
- Throws:
org.apache.torque.TorqueException
hasParents
public boolean hasParents()
throws org.apache.torque.TorqueException
- Does this AttributeOption have parents?
- Throws:
org.apache.torque.TorqueException
getParent
public AttributeOption getParent()
throws org.apache.torque.TorqueException
- Returns direct parent of this child.
- Throws:
org.apache.torque.TorqueException
deleteModuleMappings
public void deleteModuleMappings()
throws org.apache.torque.TorqueException
- Delete mappings with all modules and issue types.
- Throws:
org.apache.torque.TorqueException
deleteIssueTypeMappings
public void deleteIssueTypeMappings()
throws org.apache.torque.TorqueException
- Delete mappings with global issue types.
- Throws:
org.apache.torque.TorqueException
toString
public java.lang.String toString()
- A String representation of this object.
- Overrides:
toString in class BaseAttributeOption
isSystemDefined
public boolean isSystemDefined()
throws org.apache.torque.TorqueException
- Checks if this attribute option is associated with atleast one of the
global issue types that is system defined.
- Returns:
- True if it is associated with a System defined
global Issue Type. False otherwise.
- Throws:
org.apache.torque.TorqueException
Copyright © 2000-2004 Tigris.org. All Rights Reserved.