planetj.database.field
Class SQLAssociationField

java.lang.Object
  |
  +--planetj.database.Field
        |
        +--planetj.database.field.SQLOperationField
              |
              +--planetj.database.field.SQLAssociationField
All Implemented Interfaces:
Cloneable, ICSVField, IExternallyNamed, IFDFObject, IGuarded, INamed, IXMLObject, Serializable
Direct Known Subclasses:
OneToManyAssociationField, OneToOneAssociationField

public abstract class SQLAssociationField
extends SQLOperationField

Represents an association between two SQL tables

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class planetj.database.Field
Field.FieldLocation
 
Field Summary
 
Fields inherited from interface planetj.dataengine.security.IGuarded
TYPE_ID_UNKNOWN, TYPE_NAME_FIELD, TYPE_NAME_SQLOPERATION, TYPE_SECURED_BY_LEVEL, TYPE_SECURED_BY_OPERATION, TYPE_UNSECURED
 
Constructor Summary
SQLAssociationField()
           
 
Method Summary
 boolean equals(Object otherField)
          Tests if another field is equal to this field.
static Object getAssociation(Field field)
          Deprecated. replaced with getAssociation(Field, ExecutingContext) because with the executing context, user parameters can now be included in association sqls operations
static Object getAssociation(Field field, ExecutingContext ec)
          Get the association from the given Field.
static Object getAssociation(Operation associationOp, Row row, ExecutingContext ec)
          Get the association from the given operation.
 Object getCopiedValue()
          Gets an independent copy of this field's value.
 String getDisplayValue()
          Returns the display value of this Field as a String
 String getSQLValue(boolean pUseOriginalValue)
          Returns the Field's value in SQL format.
 Object getValue()
          Returns the Field's current value.
 boolean getValueAsBoolean()
          Subclasses must override this to detirmine what their boolean value is.
 boolean isUpdateable()
          Tests if this field can be updated by the user.
 boolean isValueEqual(Object obj)
          Return a boolean indicating if the passed in Object is equal to this Fields value.
 
Methods inherited from class planetj.database.field.SQLOperationField
createObject, getDefaultDatabaseValue, getSQLType, getValueAsByte, getValueAsDouble, getValueAsFloat, getValueAsInt, isNumeric, isString, isValueGreaterThan, isValueLessThan, toString
 
Methods inherited from class planetj.database.Field
addFieldClassForDataClass, addPropertyChangeListener, appendSQLColumnDefinition, appendSQLNameAndValue, appendSQLNameAndValue, clearValidationExceptions, cloneField, commitValue, concat, create, create, createFromDataType, divide, executeGetterMethod, executeSetterMethod, getAssociationOperation, getAttribute, getAutoUpdateValue, getColumnSpan, getConfigProperty, getCSVField, getCurrentValue, getCurrentValueAsString, getDataSQLOperation, getDate, getDefaultExternalName, getDefaultUsageId, getDefaultValue, getDisplayHeight, getDisplayLength, getDisplayOrder, getDisplayWidth, getExternalName, getExternalValidationKey, getFDFData, getFieldClassForDataClass, getFieldDescriptor, getFieldDescriptorSource, getFieldIncrementor, getIndex, getLibrary, getLibraryName, getMaxLength, getMaxLength, getMetaDataSystemAlias, getName, getOldValue, getOldValueAsString, getPossibleValues, getPossibleValues, getPreferredDisplayLength, getPreferredJavaDataType, getRow, getSecuredTypeId, getSecuredTypeName, getSecurityType, getSQLColumnDefinition, getSQLColumnDefinition, getSQLNameAndDefaultValue, getSQLNameAndValue, getSQLNameAndValue, getSQLObject, getSQLType, getSQLTypeName, getSQLTypeName, getSQLValue, getSQLValue, getStaticAttribute, getStyleClass, getStyleClass, getSystem, getSystemAlias, getSystemURL, getTable, getTableName, getValidationExceptions, getValidationInvalidLengthString, getValidationInvalidMinLengthString, getValidationInvalidValueString, getValidationInvalidValueString, getValidationRequiredString, getValidValuesString, getValueAsDate, getValueAsFullLengthString, getValueAsLong, getValueAsNumber, getValueAsShort, getValueAsString, getXMLData, getXMLTag, guessFieldClassProbability, handlePossibleValueOperation, hasMultipleStyleClasses, hasOldValue, hasPossibleValuesKeyClassOrOp, hasPossibleValuesSQLOperation, hasPossibleValuesSQLOperation, hasValue, isApplicable, isAuthorizedForEdit, isAuthorizedForRead, isAutoUpdateValue, isBoolean, isChanged, isContainsValue, isCurrentValueField, isCurrentValueString, isDate, isDecimalSQLType, isDecimalSQLType, isDefaultValue, isDerived, isDisplayable, isFieldContentDisplayable, isFieldValueDatabaseDefault, isFieldValueNotBlank, isFieldValueNull, isFileUpload, isGuarded, isHelpTextPresent, isInitialized, isNumericSQLType, isNumericSQLType, isPassword, isPhysical, isPossibleValuesSearch, isReadOnly, isReadOnly, isRequired, isRequired, isRequiredOnSearch, isSkeleton, isStringSQLType, isStringSQLType, isTime, isValidationRequiredForAutoPopulate, isValidLength, isValidLength, isValidMinLength, isValidRequired, isValidRequired, isValidValue, isValidValue, isValueEqualToString, lessThan, removePropertyChangeListener, rollbackChanges, setAttribute, setChanged, setClonedValues, setDate, setFieldContentDisplayable, setFieldDescriptor, setInitialValue, setInitialValueAsString, setMaxLength, setName, setRow, setSavepoint, setSQLType, setSQLTypeName, setStaticAttribute, setTable, setValue, setValue, setValue, setValueAsString, setValueToDefault, toUpperCase, validate, validate, validate
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SQLAssociationField

public SQLAssociationField()
Method Detail

equals

public boolean equals(Object otherField)
Tests if another field is equal to this field. Two fields are equal if and only if they have the same name and their values are equal.

Overrides:
equals in class Field

getAssociation

public static Object getAssociation(Field field)
                             throws CMException
Deprecated. replaced with getAssociation(Field, ExecutingContext) because with the executing context, user parameters can now be included in association sqls operations

Returns the Field's current value. This will be a RowCollection

Returns:
Object
CMException

getCopiedValue

public Object getCopiedValue()
Gets an independent copy of this field's value. If the value is immutable, then this method can simply return the value. Otherwise, a clone of the value should be returned.

Specified by:
getCopiedValue in class Field

getDisplayValue

public String getDisplayValue()
                       throws CMException
Returns the display value of this Field as a String

Overrides:
getDisplayValue in class Field
Returns:
java.lang.String
CMException

getSQLValue

public String getSQLValue(boolean pUseOriginalValue)
                   throws CMException
Returns the Field's value in SQL format. For example, if this field's value is the number 3 then the String "3" is returned. If this field's value is the String "Hello" then the String "'Hello'" is returned.

Specified by:
getSQLValue in class Field
Parameters:
pUseOriginalValue - If this is true then the value used will be this field's original value as it was read from the database. Otherwise its current value is used.
CMException

getValue

public Object getValue()
Returns the Field's current value. This will be a Row, RowCollection, or null.

Specified by:
getValue in interface INamed
Overrides:
getValue in class Field
Returns:
Object

getValueAsBoolean

public boolean getValueAsBoolean()
Subclasses must override this to detirmine what their boolean value is. Returns a primitive that represents the value in the specified field.

Overrides:
getValueAsBoolean in class SQLOperationField
Returns:
boolean

isUpdateable

public boolean isUpdateable()
Tests if this field can be updated by the user. Some types of fields may not be updateable; for those types this method should be overridden to return false.

Overrides:
isUpdateable in class Field

isValueEqual

public boolean isValueEqual(Object obj)
Return a boolean indicating if the passed in Object is equal to this Fields value.

Specified by:
isValueEqual in class Field

getAssociation

public static Object getAssociation(Field field,
                                    ExecutingContext ec)
                             throws CMException
Get the association from the given Field.

Parameters:
field - Field containing association to get
ec - context in which the user is executing
Returns:
either a Row or a RowCollection depending upon the associations type
CMException

getAssociation

public static Object getAssociation(Operation associationOp,
                                    Row row,
                                    ExecutingContext ec)
                             throws CMException
Get the association from the given operation.

Parameters:
associationOp - association Operation to execute
row - Row containing possible values for the association's parameters
ec - context in which the user is executing
Returns:
either a Row or a RowCollection depending upon the associations type
CMException