com.sri.emo.dbobj
Class RelationType

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.RowSecuredDBObject
                      extended by com.sri.emo.dbobj.RelationType
All Implemented Interfaces:
Cacheable, ContextNested, DataObject, Securable, LookupInterface, IViewable, Serializable

public class RelationType
extends RowSecuredDBObject
implements IViewable

The types of relations between nodes in the model.

Explanation of Strength of Relation

Strong relation mean that a tree-based delete or tagging will FOLLOW relation down tree. A weak relation terminates any tree at the src node.

Author:
Larry Hamel, Michael Rimov
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[][] ALL_RELATION_TYPES
          we automatically populate this subset of relations
static String DEST_ASSOCIATED_SRC
           
static String DEST_CONTAINS_SRC
           
static String DEST_IS_EXAMPLE_OF_SRC
           
static String DEST_IS_PART_OF_SRC
           
static String RELATION_INVERSE
          marker for whether this relation has an inverse ("reflexive" relations have inverses)
static String RELATION_STRENGTH
           
static String RELATION_TYPE_DESCRIP
           
static String RELATION_TYPE_DISPLAY_NAME
           
static String RELATION_TYPE_NAME
           
static String STRONG_RELATION
          Strong relations will result in a child being destroyed with the parent (Unless the child also belongs to a strong relation of another parent.
static String WEAK_RELATION
          Indicates that there is an association, but there is no use of it for dealing with entity traversals when selecting trees.
 
Fields inherited from class com.jcorporate.expresso.core.dbobj.RowSecuredDBObject
DEFAULT_PERMISSION_CODE
 
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
RelationType()
          Default constructor for RelationType creates a new object of this type with no connection yet allocated.
 
Method Summary
 void add()
          If the user is allowed to add, invoke the superclass add
 void delete()
          Delete a record from the target table
 String getInverseRel()
           
 RelationType getInverseRelType()
           
 List getParts()
          Get parts of ANY object with this relation type from database, NOT from cache.
 List getRelations()
          get all Relations of this type, across entire universe of object types
 String getRelTypeDescrip()
           
 String getRelTypeDisplayName()
           
static String getRelTypeDisplayName(String typename)
           
 String getRelTypeName()
           
 String getStrength()
           
 Vector getValidValues(String fieldName)
          Popup list for inverse relations.
 Transition getViewTrans()
          provide a transition for viewing this object, suitable for creating an HTTP link
 boolean hasInverseRelation(String type)
           
 boolean isReflexive()
           
 boolean isStrong()
           
 void setInverseRel(String inverse)
           
 void setRelDescrip(String descrip)
           
 void setRelDisplayName(String displayName)
           
 void setRelType(String nodeRelation)
           
 void setStrength(String newValue)
           
 void setStrongRelation(boolean strongRelation)
           
protected  void setupFields()
          Defines the database table name and fields for this DB object
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.RowSecuredDBObject
add, addGroupPerm, canRequesterAdministrate, canRequesterRead, canRequesterWrite, checkDeleteDetailPerm, checkKeyLength, defaultGroup, defaultPermissions, delete, deleteAll, find, getAdministrateGroups, getGroups, getPermissions, getReadGroups, getWriteGroups, isAdminGroup, isReadGroup, isRowAllowed, isRowAllowed, isWriteGroup, ownerID, removeGroup, retrieve, searchAndRetrieveList, searchAndRetrieveList, setPermissions, setPermissions, update
 
Methods inherited from class com.jcorporate.expresso.core.dbobj.SecuredDBObject
canRequesterAdd, canRequesterDelete, canRequesterUpdate, checkAllowed, copyAttributes, count, createSecurityCache, getRequestingUid, getRequestingUser, getString, getString, getString, getString, getString, getString, getSystemUid, instantiate, isAllowed, search, 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, checkField, checkMutable, checkRef, checkRef, clear, clearDistinctFields, clearError, clearFieldsToInput, clearFieldsToRetrieve, clearSortKeys, clone, containsWildCards, copyAllFields, 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, 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
 

Field Detail

RELATION_TYPE_NAME

public static final String RELATION_TYPE_NAME
See Also:
Constant Field Values

RELATION_TYPE_DISPLAY_NAME

public static final String RELATION_TYPE_DISPLAY_NAME
See Also:
Constant Field Values

RELATION_TYPE_DESCRIP

public static final String RELATION_TYPE_DESCRIP
See Also:
Constant Field Values

RELATION_INVERSE

public static final String RELATION_INVERSE
marker for whether this relation has an inverse ("reflexive" relations have inverses)

See Also:
Constant Field Values

RELATION_STRENGTH

public static final String RELATION_STRENGTH
See Also:
Constant Field Values

DEST_IS_PART_OF_SRC

public static final String DEST_IS_PART_OF_SRC
See Also:
Constant Field Values

DEST_CONTAINS_SRC

public static final String DEST_CONTAINS_SRC
See Also:
Constant Field Values

DEST_ASSOCIATED_SRC

public static final String DEST_ASSOCIATED_SRC
See Also:
Constant Field Values

DEST_IS_EXAMPLE_OF_SRC

public static final String DEST_IS_EXAMPLE_OF_SRC
See Also:
Constant Field Values

STRONG_RELATION

public static final String STRONG_RELATION
Strong relations will result in a child being destroyed with the parent (Unless the child also belongs to a strong relation of another parent.

See Also:
Constant Field Values

WEAK_RELATION

public static final String WEAK_RELATION
Indicates that there is an association, but there is no use of it for dealing with entity traversals when selecting trees.

See Also:
Constant Field Values

ALL_RELATION_TYPES

public static final String[][] ALL_RELATION_TYPES
we automatically populate this subset of relations

Constructor Detail

RelationType

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

Throws:
DBException - If the new object cannot be created
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

getValidValues

public Vector getValidValues(String fieldName)
                      throws DBException
Popup list for inverse relations.

Overrides:
getValidValues in class DBObject
Parameters:
fieldName - The name of the fields for which a value set is requested
Returns:
A Vector of ValidValue objects, omitting the "this" relation since a relation cannot be its own inverse
Throws:
DBException - upon error

setInverseRel

public void setInverseRel(String inverse)
                   throws DBException
Throws:
DBException

getInverseRel

public String getInverseRel()
                     throws DBException
Throws:
DBException

getRelTypeDisplayName

public static String getRelTypeDisplayName(String typename)
                                    throws DBException
Throws:
DBException

hasInverseRelation

public boolean hasInverseRelation(String type)
                           throws DBException
Throws:
DBException

getRelTypeDescrip

public String getRelTypeDescrip()
                         throws DBException
Throws:
DBException

getRelTypeName

public String getRelTypeName()
                      throws DBException
Throws:
DBException

getRelTypeDisplayName

public String getRelTypeDisplayName()
                             throws DBException
Throws:
DBException

setRelType

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

isReflexive

public boolean isReflexive()
                    throws DBException
Throws:
DBException

getInverseRelType

public RelationType getInverseRelType()
                               throws DBException
Returns:
the inverse relation, or null if not found
Throws:
DBException - upon error
See Also:
hasInverseRelation(java.lang.String)

delete

public void delete()
            throws DBException
Delete a record from the target table

Specified by:
delete in interface DataObject
Overrides:
delete in class SecuredDBObject
Throws:
DBException - if delete is not allowed for the current user

add

public void add()
         throws DBException
If the user is allowed to add, invoke the superclass add

Specified by:
add in interface DataObject
Overrides:
add in class RowSecuredDBObject
Throws:
DBException - If the user is not permitted to add or if the add fails

getRelations

public List getRelations()
                  throws DBException
get all Relations of this type, across entire universe of object types

Returns:
list of all Relations of this type, across entire universe of object types
Throws:
DBException - upon error

getParts

public List getParts()
              throws DBException
Get parts of ANY object with this relation type from database, NOT from cache.

Returns:
List of parts.
Throws:
DBException - upon database query error.

setRelDescrip

public void setRelDescrip(String descrip)
                   throws DBException
Throws:
DBException

setRelDisplayName

public void setRelDisplayName(String displayName)
                       throws DBException
Throws:
DBException

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 object; never null
Throws:
DBException - upon query parameter error.

setStrength

public void setStrength(String newValue)
                 throws DBException
Throws:
DBException

getStrength

public String getStrength()
                   throws DBException
Throws:
DBException

setStrongRelation

public void setStrongRelation(boolean strongRelation)
                       throws DBException
Throws:
DBException

isStrong

public boolean isStrong()
                 throws DBException
Throws:
DBException


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