planetj.database.field
Interface ICurrentValueField

All Known Implementing Classes:
LastUpdateTimestampField, UserIdField

public interface ICurrentValueField

Subclasses of Field that set a dynamic value for both insert & update should implement this method as a marker. Field already implements the necessary methods for this interface although the getCurrentValue does nothing more than return the set value of the Field as an Object. Field return String values from getAutoUpdateValue & getDefaultValue. isAutoUpdate & isDefaultValue check the field descriptor to see if these values are requested as current. When implementing this interface subclasses of Field should override these methods to return a type other than string. Replaces "realtime". Creation date: (3/3/2003 5:08:28 PM)


Field Summary
static String CURRENT_VALUE
           
 
Method Summary
 Object getAutoUpdateValue(ExecutingContext executingContext)
          This method should be overriden in subclasses of field that wish to set a dynamic value for update.
 Object getCurrentValue(ExecutingContext executingContext)
          Returns a value that may be retrieved from a database, current time, calculation or other source that is dynamic.
 String getCurrentValueAsString(ExecutingContext executingContext)
          Convenience method to return the current value as a String.
 Object getDefaultValue(ExecutingContext executingContext)
          This method should be overriden in subclasses of field that wish to set a dynamic value for insert.
 

Field Detail

CURRENT_VALUE

public static final String CURRENT_VALUE
See Also:
Constant Field Values
Method Detail

getAutoUpdateValue

public Object getAutoUpdateValue(ExecutingContext executingContext)
                          throws CMException
This method should be overriden in subclasses of field that wish to set a dynamic value for update.

CMException

getCurrentValue

public Object getCurrentValue(ExecutingContext executingContext)
                       throws CMException
Returns a value that may be retrieved from a database, current time, calculation or other source that is dynamic. This method should be overriden in subclasses of field that wish to set a dynamic value for insert or update.

CMException

getCurrentValueAsString

public String getCurrentValueAsString(ExecutingContext executingContext)
                               throws CMException
Convenience method to return the current value as a String.

CMException

getDefaultValue

public Object getDefaultValue(ExecutingContext executingContext)
                       throws CMException
This method should be overriden in subclasses of field that wish to set a dynamic value for insert.

CMException