com.sri.emo.dbobj
Class Part

java.lang.Object
  extended by com.jcorporate.expresso.core.dataobjects.BaseDataObject
      extended by com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
          extended by com.jcorporate.expresso.core.dbobj.DBObject
              extended by com.jcorporate.expresso.core.dbobj.SecuredDBObject
                  extended by com.jcorporate.expresso.core.dbobj.SecurDBObject
                      extended by com.sri.emo.dbobj.Part
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, Securable, LookupInterface, IViewable, ModelVisitable, Serializable, Comparable

public class Part
extends SecurDBObject
implements Comparable, ModelVisitable

A part of an "entity" (a Node object). Our modeling environment allows dynamic building of objects. Parts have a complex typing system because the "type" field is overloaded for two kinds of parts: owned attributes and shared nodes.

For owned attributes, the Type field is a simple string, unique within the parent object.

For shared nodes, the Type field is the nodeType of the shared nodes. However, multiple parts within a single entity can be of "shared node" type AND share the same kind of node. For example, Is a kind of/These are kinds of me -- these two part labels apply to the same kind of shared node, so their part types are the same. Parts which are shared-node parts are distinguished (uniquely) by a combination of part type, relation type, and parent type.

Author:
larry hamel
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jcorporate.expresso.core.dbobj.DBObject
DBObject.FieldError, DBObject.FieldUpdate
 
Field Summary
static String CARDINALITY
           
static String[][] CARDINALITY_CHOICES
           
static String DELIMITER
           
static String DEST_NODE_REF
           
static String KEEP_DETAILS
           
static String MULTIPLE_ALLOWED
          attribute limitation constants (could be in other "def" table)
static String NODE_PART_RELATION_TYPE
           
static String NOT_SPECIFIED_ID
           
static String PARENT_TYPE
           
static String PART_DESCRIP
           
static String PART_DISPLAY_NAME
           
static String PART_HELP_STRING
           
static String PART_ID
          field names
static String PART_IS_ATTRIB
           
static String PART_LABEL
           
static String PART_NUM
           
static String PART_TYPE
           
static String PART_TYPE_TABLE_NAME
           
static String PICKLIST_SINGLE_ALLOWED
           
static String REL_REF
           
static String SINGLE_ALLOWED
           
static String[] SINGLE_CARDINALITY_CHOICES
           
static String SPECIAL_HANDLER
           
static String SRC_NODE_REF
           
static String SUMMARY_SINGLE_ALLOWED
           
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
ADD, ALL_FUNCTIONS, CACHE_NAME, CACHE_TTY, DELETE, SEARCH, SYSTEM_ACCOUNT_NAME, UPDATE
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.DBObject
ATTRIBUTE_ERROR, ATTRIBUTE_ERROR_MESSAGE, ATTRIBUTE_PAGE_LIMIT, BIG_DECIMAL_ZERO, CACHE_LIMIT_PERCENT, CACHE_LIMIT_TTL, EMAIL_MASK, EVENT_ADD, EVENT_DELETE, EVENT_UPDATE, FLOAT_MASK, INT_MASK, IS_CHECK_RELATIONAL_INTEGRITY, IS_MUTABLE, sCacheStats, UPDATE_CHANGED_ONLY, WHERE_KEYWORD
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
anyFieldsDistinct, anyFieldsToInput, anyFieldsToRetrieve, appendCustomWhere, caseSensitiveQuery, customWhereClause, dbKey, distinctFields, inputFields, localConnection, LONGBINARY_READ_DEFAULT_SIZE, maxRecords, myClassName, myUpdates, offsetRecord, recordSet, retrieveFields, sMetadataMap, sortKeys
 
Fields inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
currentStatus, globalMask
 
Fields inherited from interface com.jcorporate.expresso.core.dataobjects.Securable
SYSTEM_ACCOUNT
 
Fields inherited from interface com.jcorporate.expresso.core.dataobjects.DataObject
STATUS_CURRENT, STATUS_DELETED, STATUS_NEW, STATUS_UPDATED
 
Constructor Summary
Part()
          Default constructor for Part creates a new object of this type with no connection yet allocated.
Part(ControllerRequest request)
          Deprecated.  
Part(SecuredDBObject obj)
           
 
Method Summary
 void acceptVisitor(ModelVisitor visitor)
          Accepts the visitor and redirects the visitor to the appropriate type we're dealing with.
 void add()
          we override not to check permissions (which is done at the table level by superclass) but rather to add default permissions
 boolean areMultipleAttributesAllowed()
           
 void changeRelations(String oldNodeRelation)
          change all relations associated with this part IFF the nodeRelation changed
 int compareTo(Object o)
          Compares this object with the specified object for order.
 void delete()
          Delete a part; deletes all attribs or relations associated with this part, unless the part has a KEEP_DETAILS attribute (an expresso attribute associated with the dbobject)
 void deleteRelations()
          Delete all relations associated with this part.
 String getCardinality()
           
 String getCardinalityLabel()
          Retrieves the label for the cardinality.
 IPartHandler getCustomHandler()
           
 String getDefinition(boolean isHTML)
          for definition page,
 String getDisplayTitleOfParentNodeType(int requestingUid)
          Return display title of node type of parent node, or empty string "" if not found.
 Transition getEditTrans(String nodeId, Map params)
          provide a transition for editing this part, suitable for creating an HTTP link
 String getId()
           
 String getNodeRelation()
          Return code for node relation type.
 RelationType getNodeRelationEntity()
           
 String getNodeRelationLabel(ExpressoRequest request)
           
 String getNodeRelationObjectLabel()
           
 NodeType getParentEntity()
           
 String getParentType()
           
 String getPartDescription()
           
 String getPartDescriptionRaw()
           
static Part getPartFromXMLName(String name)
           
 String getPartLabel()
           
 String getPartNum()
           
 int getPartNumInt()
           
 String getPartType()
           
 String getPartUniqueId()
           
 List getPickList()
           
 List getPicklist(ExpressoRequest request)
           
 List getPickList(String dataContext, int uid)
           
 String[][] getPicklistArray(ExpressoRequest request)
           
 String[][] getPicklistArrayAssumeSecure()
           
 ValidValue[] getPickListValidValues()
           
 String getPicklistXMLName()
           
 List getRelations()
           
 String getSpecialHandlerName()
           
 Transition getViewTrans()
          provide a transition for viewing this object, suitable for creating an HTTP link
 boolean hasPicklist()
           
 void isAllowed(String requestedFunction)
          See if the current user of this DB object is allowed to perform the requested function, given the function's code.
 boolean isHaveCustomHandler()
           
 boolean isMultipleAllowed()
          can be for attribute OR shared relation; simply describes cardinality
 boolean isOwnedAttribute()
           
 void isOwnedAttribute(boolean attribute)
           
 boolean isRowAllowed(String requestedFunction)
          override to use permissions of parent node type
 boolean isSharedNodeAttrib()
           
 boolean isSingleValued()
          Can be for attribute OR shared relation; simply describes cardinality.
 boolean isSummary()
           
 int numDisplayLines()
           
 void refreshSpecialHandlerCache()
           
 void setCustomHandler(String customHandler)
           
 void setId(String id)
           
 void setNodeRelation(String nodeRelation)
           
 void setParentType(String type)
           
 void setPartCardinality(String card)
           
 void setPartDescrip(String s)
           
 void setPartId(int partId)
           
 void setPartId(String partId)
           
 void setPartLabel(String s)
           
 void setPartNum(int i)
           
 void setPartType(String partType)
           
 void setSpecialHandler(String s)
           
protected  void setupFields()
          Defines the database table name and fields for this DB object
 void update()
          add cache maintenance
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
canRequesterAdd, canRequesterDelete, canRequesterRead, canRequesterUpdate, checkAllowed, copyAttributes, count, createSecurityCache, deleteAll, find, getRequestingUid, getRequestingUser, getString, getString, getString, getString, getString, getString, getSystemUid, instantiate, retrieve, search, searchAndRetrieveList, searchAndRetrieveList, setRequestingUid, setRequestingUser
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.DBObject
addDetail, addField, addField, addFieldError, addFoundKeys, addIfNeeded, addIndex, addKey, addMaster, addOrUpdate, addSortKey, addTransition, addVirtualField, addVirtualField, addVirtualField, addVirtualField, average, basicAdd, cacheIsChangedComparison, canUseRetrieve, checkAllReferredToBy, checkAllRefs, checkAllRefsPublic, checkDeleteDetailPerm, checkField, checkMutable, checkRef, checkRef, clear, clearDistinctFields, clearError, clearFieldsToInput, clearFieldsToRetrieve, clearSortKeys, clone, containsWildCards, copyAllFields, delete, deleteAll, deleteDetails, denotesRange, equals, fetchImmut, fetchImmutable, forKey, formatDateTime, get, getAllAttributes, getAttribute, getAttributesIterator, getBooleanFieldValue, getCacheSize, getCacheStatsMap, getCacheUtil, getCheckZeroUpdate, getCustomWhereClause, getDataContext, getDataField, getDataTransferObject, getDBName, getDetails, getDistinctFieldCount, getDistinctFields, getField, getFieldAttributesIterator, getFieldBigDecimal, getFieldBoolean, getFieldByte, getFieldByteArray, getFieldData, getFieldDate, getFieldDecimalFormatted, getFieldDouble, getFieldErrorMessage, getFieldFloat, getFieldInt, getFieldLong, getFieldMetaData, getFieldShort, getFieldsToInputCount, getFieldsToRetrieveCount, getFilterClass, getFoundCount, getFoundKeysArray, getIndexArray, getISOValuesDefault, getISOValuesDefault, getISOValuesDefault, getKey, getKeyFieldListIterator, getLength, getLengthInt, getLocale, getLogger, getLookupObject, getMax, getMax, getMaxRecords, getMyKeys, getMyUpdatesArray, getOffsetRecord, getPatternMatcher, getPrecision, getSerializedForm, getSizeEstimate, getStringFilter, getThisDBbj, getThisDBObj, getValidValueDescrip, getValidValues, getValidValuesList, getValues, getValuesDefault, getValuesDefault, getValuesDefault, hasError, hasErrors, haveAllKeys, initialize, isCached, isChanged, isDistinct, isEmpty, isFieldDistinct, isFieldNull, isFieldsToInput, isFieldsToRetrieve, isFieldToRetrieve, isMultiValued, isMutable, isMutable, isReadOnly, isSecret, isVirtual, loadFromConnection, logChange, max, min, newInstance, noNewLine, noQuotes, notifyListeners, populateDefaultValues, referredToBy, removeAttribute, removeFromCache, retrieveFromCache, saveBinaryField, search, set, setAttribute, setCacheLimit, setCacheLimit, setCacheLimitAsPercent, setCacheSize, setCharset, setCheckZeroUpdate, setConnection, setConnection, setCustomWhereClause, setCustomWhereClause, setDataContext, setDataField, setDataTransferObject, setDefaultValue, setDescription, setField, setField, setField, setField, setField, setField, setField, setField, setField, setField, setFieldData, setFieldData, setFieldDistinct, setFieldsToInput, setFieldsToRetrieve, setFilterClass, setFilterClass, setKey, setKeys, setLocale, setLookupField, setLookupObject, setMask, setMaxRecords, setMultiValued, setName, setOffsetRecord, setReadOnly, setSchema, setSecret, setSortKey, setStringFilter, setStringFiltersOnAll, setTargetDbSchema, setTargetTable, sqlAggrFunction, sum, toDebugString, update, updateAll, updateAll, updateIsChanged, verify
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.jdbc.JDBCDataObject
addInParam, addOutParam, buildWhereClause, buildWhereClauseBuffer, checkZeroUpdate, constructNewMetaData, createAndExecuteSearch, createAndRunStoreProcedure, createSQLSelectStatement, createSQLSelectStatement, getConnectionPool, getCustomStringFieldValue, getDef, getDistinctFieldArrayList, getExecutor, getFieldsToInputIterator, getFieldsToRetrieveIterator, getJDBCMetaData, getJDBCUtil, getLocalConnection, getMappedDataContext, getMetaData, getQueryInterface, getSerialForm, loadFromConnection, makeLimitationStub, quoteIfNeeded, runStoredProcedure, runStoredProcedureAndRetrieveList, selectFieldString, setCaseSensitiveQuery, setDBConnectionPool, setDBName, setMappedDataContext, setOriginalDBName, setTargetStoreProcedure
 
Methods inherited from class com.jcorporate.expresso.core.dataobjects.BaseDataObject
getGlobalMask, getStatus, isGlobalMasked, setFieldsWithDefaults, setGlobalMask, setStatus
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jcorporate.expresso.core.dataobjects.Securable
getRequestingUid, setRequestingUid, setRequestingUser
 

Field Detail

PART_TYPE_TABLE_NAME

public static final String PART_TYPE_TABLE_NAME
See Also:
Constant Field Values

KEEP_DETAILS

public static final String KEEP_DETAILS
See Also:
Constant Field Values

DELIMITER

public static final String DELIMITER
See Also:
Constant Field Values

PART_ID

public static final String PART_ID
field names

See Also:
Constant Field Values

PARENT_TYPE

public static final String PARENT_TYPE
See Also:
Constant Field Values

PART_NUM

public static final String PART_NUM
See Also:
Constant Field Values

PART_LABEL

public static final String PART_LABEL
See Also:
Constant Field Values

SPECIAL_HANDLER

public static final String SPECIAL_HANDLER
See Also:
Constant Field Values

PART_TYPE

public static final String PART_TYPE
See Also:
Constant Field Values

NODE_PART_RELATION_TYPE

public static final String NODE_PART_RELATION_TYPE
See Also:
Constant Field Values

CARDINALITY

public static final String CARDINALITY
See Also:
Constant Field Values

PART_DESCRIP

public static final String PART_DESCRIP
See Also:
Constant Field Values

PART_IS_ATTRIB

public static final String PART_IS_ATTRIB
See Also:
Constant Field Values

MULTIPLE_ALLOWED

public static final String MULTIPLE_ALLOWED
attribute limitation constants (could be in other "def" table)

See Also:
Constant Field Values

SINGLE_ALLOWED

public static final String SINGLE_ALLOWED
See Also:
Constant Field Values

SUMMARY_SINGLE_ALLOWED

public static final String SUMMARY_SINGLE_ALLOWED
See Also:
Constant Field Values

PICKLIST_SINGLE_ALLOWED

public static final String PICKLIST_SINGLE_ALLOWED
See Also:
Constant Field Values

NOT_SPECIFIED_ID

public static final String NOT_SPECIFIED_ID
See Also:
Constant Field Values

CARDINALITY_CHOICES

public static final String[][] CARDINALITY_CHOICES

SINGLE_CARDINALITY_CHOICES

public static final String[] SINGLE_CARDINALITY_CHOICES

PART_DISPLAY_NAME

public static final String PART_DISPLAY_NAME
See Also:
Constant Field Values

PART_HELP_STRING

public static final String PART_HELP_STRING
See Also:
Constant Field Values

REL_REF

public static final String REL_REF
See Also:
Constant Field Values

SRC_NODE_REF

public static final String SRC_NODE_REF
See Also:
Constant Field Values

DEST_NODE_REF

public static final String DEST_NODE_REF
See Also:
Constant Field Values
Constructor Detail

Part

public Part()
     throws DBException
Default constructor for Part creates a new object of this type with no connection yet allocated.

Throws:
DBException - If the new object cannot be created

Part

public Part(ControllerRequest request)
     throws DBException
Deprecated. 

Parameters:
request - ControllerRequest
Throws:
DBException

Part

public Part(SecuredDBObject obj)
     throws DBException
Throws:
DBException
Method Detail

setupFields

protected void setupFields()
                    throws DBException
Defines the database table name and fields for this DB object

Overrides:
setupFields in class DBObject
Throws:
DBException - if the operation cannot be performed

setParentType

public void setParentType(String type)
                   throws DBException
Throws:
DBException

getPartLabel

public String getPartLabel()
                    throws DBException
Throws:
DBException

getPartType

public String getPartType()
                   throws DBException
Throws:
DBException

isOwnedAttribute

public boolean isOwnedAttribute()
                         throws DBException
Throws:
DBException

getPartNum

public String getPartNum()
                  throws DBException
Throws:
DBException

getSpecialHandlerName

public String getSpecialHandlerName()
                             throws DBException
Throws:
DBException

getCardinality

public String getCardinality()
                      throws DBException
Throws:
DBException

getPartDescription

public String getPartDescription()
                          throws DBException
Throws:
DBException

setPartType

public void setPartType(String partType)
                 throws DBException
Throws:
DBException

getParentType

public String getParentType()
                     throws DBException
Throws:
DBException

getNodeRelation

public String getNodeRelation()
                       throws DBException
Return code for node relation type.

Returns:
String, the node relation type.
Throws:
DBException - upon database exception error.

setNodeRelation

public void setNodeRelation(String nodeRelation)
                     throws DBException
Throws:
DBException

getParentEntity

public NodeType getParentEntity()
                         throws DBException
Throws:
DBException

getDefinition

public String getDefinition(boolean isHTML)
                     throws DBException
for definition page,

Parameters:
isHTML - signals whether to use HTML tags, or if false, to use Docbook tags
Returns:
true The definition, in Docbook or Html text
Throws:
DBException - upon database exception error.

setId

public void setId(String id)
           throws DBException
Throws:
DBException

getId

public String getId()
             throws DBException
Throws:
DBException

setPartNum

public void setPartNum(int i)
                throws DBException
Throws:
DBException

hasPicklist

public boolean hasPicklist()
                    throws DBException
Returns:
true if this attribute has a picklist
Throws:
DBException - upon database exception error.

isHaveCustomHandler

public boolean isHaveCustomHandler()
                            throws DBException
Throws:
DBException

getCustomHandler

public IPartHandler getCustomHandler()
                              throws DBException
Returns:
the custom editting handler or null if this part does not have one
Throws:
DBException - upon database exception error.

setCustomHandler

public void setCustomHandler(String customHandler)
                      throws DBException
Throws:
DBException

getDisplayTitleOfParentNodeType

public String getDisplayTitleOfParentNodeType(int requestingUid)
Return display title of node type of parent node, or empty string "" if not found.

Parameters:
requestingUid - the requesting uid.
Returns:
The display title.

getPicklistArray

public String[][] getPicklistArray(ExpressoRequest request)
                            throws DBException
Parameters:
request - the ControllerRequest for parameters.
Returns:
array of values in picklist, with each row containing ID, display; null if attribute has no picklist
Throws:
DBException - upon database exception error.

getPicklist

public List getPicklist(ExpressoRequest request)
                 throws DBException
Throws:
DBException

getPickList

public List getPickList(String dataContext,
                        int uid)
                 throws DBException
Throws:
DBException

getPickList

public List getPickList()
                 throws DBException
Returns:
list of PickList items; never null
Throws:
DBException

getPickListValidValues

public ValidValue[] getPickListValidValues()
                                    throws DBException
Throws:
DBException

isSummary

public boolean isSummary()
                  throws DBException
Returns:
true if this attribute is a summary
Throws:
DBException - upon database exception error.

areMultipleAttributesAllowed

public boolean areMultipleAttributesAllowed()
                                     throws DBException
Returns:
true if this attribute allows multiple entries
Throws:
DBException - upon database exception error.

numDisplayLines

public int numDisplayLines()
                    throws DBException
Throws:
DBException

refreshSpecialHandlerCache

public void refreshSpecialHandlerCache()

delete

public void delete()
            throws DBException
Delete a part; deletes all attribs or relations associated with this part, unless the part has a KEEP_DETAILS attribute (an expresso attribute associated with the dbobject)

Specified by:
delete in interface DataObject
Overrides:
delete in class SecuredDBObject
Throws:
DBException - if delete is not allowed for the current user
See Also:
DBObject.setAttribute(java.lang.String, java.lang.Object), KEEP_DETAILS

isRowAllowed

public boolean isRowAllowed(String requestedFunction)
                     throws DBException
override to use permissions of parent node type

Parameters:
requestedFunction - code for function -- Add, Update, Delete, Search (read)
Returns:
true if this function is allowed for this requesting user
Throws:
SecurityException - (unchecked) if not allowed
DBException - for other data-related errors.

isAllowed

public void isAllowed(String requestedFunction)
               throws SecurityException,
                      DBException
See if the current user of this DB object is allowed to perform the requested function, given the function's code.

Specified by:
isAllowed in interface Securable
Overrides:
isAllowed in class SecuredDBObject
Parameters:
requestedFunction - The code of the requested function. The codes are:
  1. A: Add
  2. S: Search
  3. U: Update
  4. D: Delete
Throws:
DBException - If the requested operation is not permitted to this user
SecurityException - if the user is not allowed access to the object.

update

public void update()
            throws DBException
add cache maintenance

Specified by:
update in interface DataObject
Overrides:
update in class SecuredDBObject
Throws:
DBException - upon database exception error.

add

public void add()
         throws DBException
we override not to check permissions (which is done at the table level by superclass) but rather to add default permissions

Specified by:
add in interface DataObject
Overrides:
add in class SecuredDBObject
Throws:
DBException - upon database exception error.

isSharedNodeAttrib

public boolean isSharedNodeAttrib()
                           throws DBException
Throws:
DBException

getRelations

public List getRelations()
                  throws DBException
Returns:
list of Relations specified by this part; Relation object retrieved from DB via custom SQL
Throws:
DBException - upon database exception error.

deleteRelations

public void deleteRelations()
                     throws DBException
Delete all relations associated with this part.

Throws:
DBException - upon database exception error.

changeRelations

public void changeRelations(String oldNodeRelation)
                     throws DBException
change all relations associated with this part IFF the nodeRelation changed

Parameters:
oldNodeRelation - the old relation; assumes new relation is in "this"
Throws:
DBException - upon database exception error.

getPartNumInt

public int getPartNumInt()
                  throws DBException
Throws:
DBException

setPartLabel

public void setPartLabel(String s)
                  throws DBException
Throws:
DBException

setPartCardinality

public void setPartCardinality(String card)
                        throws DBException
Parameters:
card - cardinality type; see constants in this file
Throws:
DBException - upon database exception error.

isOwnedAttribute

public void isOwnedAttribute(boolean attribute)
                      throws DBException
Throws:
DBException

getPartUniqueId

public String getPartUniqueId()
                       throws DBException
Returns:
either parentType + partType for owned attribs, or partType + relationship for shared
Throws:
DBException - upon database exception error.

isSingleValued

public boolean isSingleValued()
                       throws DBException
Can be for attribute OR shared relation; simply describes cardinality.

Returns:
true if this part allows only a single item
Throws:
DBException - upon getField exceptions.
See Also:
isMultipleAllowed()

getCardinalityLabel

public String getCardinalityLabel()
                           throws DBException
Retrieves the label for the cardinality.

Returns:
display label for this part's cardinality
Throws:
DBException - upon database exception error.

getNodeRelationLabel

public String getNodeRelationLabel(ExpressoRequest request)
                            throws DBException
Parameters:
request - the ControllerRequest object.
Returns:
display label of node relation for this part
Throws:
DBException - upon database exception error.

getNodeRelationObjectLabel

public String getNodeRelationObjectLabel()
                                  throws DBException
Returns:
the label of the type of node allowed for relation
Throws:
DBException - upon database exception error.

setPartDescrip

public void setPartDescrip(String s)
                    throws DBException
Throws:
DBException

setSpecialHandler

public void setSpecialHandler(String s)
                       throws DBException
Throws:
DBException

compareTo

public int compareTo(Object o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

In the foregoing description, the notation sgn(expression) designates the mathematical signum function, which is defined to return one of -1, 0, or 1 according to whether the value of expression is negative, zero or positive.

The implementor must ensure sgn(x.compareTo(y)) == -sgn(y.compareTo(x)) for all x and y. (This implies that x.compareTo(y) must throw an exception iff y.compareTo(x) throws an exception.)

The implementor must also ensure that the relation is transitive: (x.compareTo(y)>0 && y.compareTo(z)>0) implies x.compareTo(z)>0.

Finally, the implementer must ensure that x.compareTo(y)==0 implies that sgn(x.compareTo(z)) == sgn(y.compareTo(z)), for all z.

It is strongly recommended, but not strictly required that (x.compareTo(y)==0) == (x.equals(y)). Generally speaking, any class that implements the Comparable interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."

Specified by:
compareTo in interface Comparable
Parameters:
o - the Object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this Object.

getPicklistArrayAssumeSecure

public String[][] getPicklistArrayAssumeSecure()
                                        throws DBException
Throws:
DBException

setPartId

public void setPartId(int partId)
               throws DBException
Throws:
DBException

setPartId

public void setPartId(String partId)
               throws DBException
Throws:
DBException

getPartDescriptionRaw

public String getPartDescriptionRaw()
                             throws DBException
Throws:
DBException

getEditTrans

public Transition getEditTrans(String nodeId,
                               Map params)
                        throws DBException
provide a transition for editing this part, suitable for creating an HTTP link

Parameters:
nodeId - The parent node id.
params - request parameters; assumes NODE_ID is within this map
Returns:
transtion for viewing, including label for name of object; never null
Throws:
DBException - upon DBObject-related error.

getViewTrans

public Transition getViewTrans()
                        throws DBException
provide a transition for viewing this object, suitable for creating an HTTP link

Specified by:
getViewTrans in interface IViewable
Returns:
transtion for viewing, including label for name of part; never null
Throws:
DBException - upon DBObject-related error.

acceptVisitor

public void acceptVisitor(ModelVisitor visitor)
Description copied from interface: ModelVisitable
Accepts the visitor and redirects the visitor to the appropriate type we're dealing with.

Specified by:
acceptVisitor in interface ModelVisitable
Parameters:
visitor - ViewVisitor

isMultipleAllowed

public boolean isMultipleAllowed()
                          throws DBException
can be for attribute OR shared relation; simply describes cardinality

Returns:
true if this part allows multiple items
Throws:
DBException - upon DBObject-related error.
See Also:
isSingleValued()

getNodeRelationEntity

public RelationType getNodeRelationEntity()
                                   throws DBException
Returns:
the relation type for this shared relation; null if owned attribute.
Throws:
DBException - upon DBObject-related error.

getPicklistXMLName

public String getPicklistXMLName()
                          throws DBException
Throws:
DBException

getPartFromXMLName

public static Part getPartFromXMLName(String name)
                               throws DBException
Returns:
part found; null if not found
Throws:
DBException


Copyright © 2004-2006 Codeguild, Inc.. All Rights Reserved.