planetj.database.field
Class TimestampField

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

public class TimestampField
extends Field
implements Cloneable, Serializable

Author:
PlanetJ Corporation
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
TimestampField()
           
 
Method Summary
 Field cloneField()
          Returns a clone of the Field.
 Object createObject(String pStringValue)
          Create an object for this Field type using the given String.
 Object getAutoUpdateValue(ExecutingContext executingContext)
          Get the field's auto update value as a Timestamp.
 Object getCopiedValue()
          Gets an independent copy of this field's value.
 Object getCurrentValue(ExecutingContext ec)
          Gets the default current value for this field as a String.
 String getCurrentValueAsString(ExecutingContext ec)
          Gets the default current value for this field as a String.
 String getDefaultDatabaseValue()
          Subclass must override this method and return a default value to be placed in the database when this field is Not-nullable and not required.
 Object getDefaultValue(ExecutingContext executingContext)
          Get the field's default value as a Timestamp.
 String getSQLValue(boolean pUseOriginalValue)
          Returns the Field's name and value in SQL format.
 boolean getValueAsBoolean()
          Subclasses must override this to detirmine what their boolean value is.
static short guessFieldClassProbability(FieldDescriptorRow pFDRow, RowCollection pSampleData)
          Subclasses will override to take an educated guess at what the Field Class will be for this FD Row.
 boolean isValueEqual(Object obj)
          Returns a boolean indicating if this field is equal to the supplied object.
 boolean isValueGreaterThan(Object obj)
          Returns a boolean indicating if this field is greater than the supplied object.
 boolean isValueLessThan(Object obj)
          Returns a boolean indicating if this field is less then the supplied object.
 void setValue(long millis)
          Sets the current value of the Field to the specified value, and also sets the old value to the previous value.
 
Methods inherited from class planetj.database.Field
addFieldClassForDataClass, addPropertyChangeListener, appendSQLColumnDefinition, appendSQLNameAndValue, appendSQLNameAndValue, clearValidationExceptions, commitValue, concat, create, create, createFromDataType, divide, equals, executeGetterMethod, executeSetterMethod, getAssociationOperation, getAttribute, getColumnSpan, getConfigProperty, getCSVField, getDataSQLOperation, getDate, getDefaultExternalName, getDefaultUsageId, getDisplayHeight, getDisplayLength, getDisplayOrder, getDisplayValue, 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, getSQLType, getSQLTypeName, getSQLTypeName, getSQLValue, getSQLValue, getStaticAttribute, getStyleClass, getStyleClass, getSystem, getSystemAlias, getSystemURL, getTable, getTableName, getValidationExceptions, getValidationInvalidLengthString, getValidationInvalidMinLengthString, getValidationInvalidValueString, getValidationInvalidValueString, getValidationRequiredString, getValidValuesString, getValue, getValueAsByte, getValueAsDate, getValueAsDouble, getValueAsFloat, getValueAsFullLengthString, getValueAsInt, getValueAsLong, getValueAsNumber, getValueAsShort, getValueAsString, getXMLData, getXMLTag, 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, isNumeric, isNumericSQLType, isNumericSQLType, isPassword, isPhysical, isPossibleValuesSearch, isReadOnly, isReadOnly, isRequired, isRequired, isRequiredOnSearch, isSkeleton, isString, isStringSQLType, isStringSQLType, isTime, isUpdateable, 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, setValueAsString, setValueToDefault, toString, toUpperCase, validate, validate, validate
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TimestampField

public TimestampField()
Method Detail

cloneField

public Field cloneField()
                 throws CMException
Returns a clone of the Field. Overriding is necessary so we can clone the old and current values of the Field.

Overrides:
cloneField in class Field
CMException

createObject

public Object createObject(String pStringValue)
Create an object for this Field type using the given String.

Specified by:
createObject in class Field
Parameters:
pStringValue - String

getAutoUpdateValue

public Object getAutoUpdateValue(ExecutingContext executingContext)
                          throws CMException
Get the field's auto update value as a Timestamp.

Overrides:
getAutoUpdateValue in class Field
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

getCurrentValue

public Object getCurrentValue(ExecutingContext ec)
Gets the default current value for this field as a String.

Overrides:
getCurrentValue in class Field

getCurrentValueAsString

public String getCurrentValueAsString(ExecutingContext ec)
Gets the default current value for this field as a String.

Overrides:
getCurrentValueAsString in class Field

getDefaultDatabaseValue

public String getDefaultDatabaseValue()
                               throws CMException
Subclass must override this method and return a default value to be placed in the database when this field is Not-nullable and not required.

Example: A SS# is not required to be filled in by users, but the database does not allow nulls in that field. SocialSecurityField must override this method and return a default value like -1; Creation date: (4/9/2002 4:33:45 PM)

Specified by:
getDefaultDatabaseValue in class Field
Throws:
CMException

getDefaultValue

public Object getDefaultValue(ExecutingContext executingContext)
                       throws CMException
Get the field's default value as a Timestamp.

Overrides:
getDefaultValue in class Field
CMException

getSQLValue

public String getSQLValue(boolean pUseOriginalValue)
Returns the Field's name and value in SQL format.

Specified by:
getSQLValue in class Field
Parameters:
pUseOriginalValue -
Returns:
String

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.

Specified by:
getValueAsBoolean in class Field
Returns:
boolean

guessFieldClassProbability

public static short guessFieldClassProbability(FieldDescriptorRow pFDRow,
                                               RowCollection pSampleData)
Subclasses will override to take an educated guess at what the Field Class will be for this FD Row. Each subclass will examin fields such as : {DECIMAL_DIGITS, COLUMN_NAME, COLUMN_SIZE, REMARKS, DATA_TYPE, TYPE_NAME} Each subclass will detirmine the probability that it should be the field class for this FD Row. -1 will be returned if there is no chance (0%)this field is the fieldClass for pFDRow. 100 or greater will be returned if this is absolutely 100% the field class for pFDRow Creation date: (6/19/2002 2:55:49 PM)


isValueEqual

public boolean isValueEqual(Object obj)
Returns a boolean indicating if this field is equal to the supplied object. the Row the Field belongs to. Subclasses should override and implement as appropriate.

Specified by:
isValueEqual in class Field
Returns:
boolean

isValueGreaterThan

public boolean isValueGreaterThan(Object obj)
Returns a boolean indicating if this field is greater than the supplied object. the Row the Field belongs to. Subclasses should override and implement as appropriate.

Specified by:
isValueGreaterThan in class Field
Returns:
boolean

isValueLessThan

public boolean isValueLessThan(Object obj)
Returns a boolean indicating if this field is less then the supplied object. the Row the Field belongs to. Subclasses should override and return the appropriate response.

Specified by:
isValueLessThan in class Field
Returns:
boolean

setValue

public void setValue(long millis)
              throws CMException
Description copied from class: Field
Sets the current value of the Field to the specified value, and also sets the old value to the previous value. NOTE: This method will take int types also. If called and the Field is not updatable a CMException is thrown.

Overrides:
setValue in class Field
CMException