| |
|
| com.jcorporate.expresso.core.dataobjects.DataObject
All known Subclasses: com.jcorporate.expresso.core.dataobjects.BaseDataObject, com.jcorporate.expresso.core.dataobjects.SynchronizedDataObject, com.jcorporate.expresso.core.dataobjects.jdbc.JoinedDataObject,
DataObject | public interface DataObject extends Cacheable,ContextNested(Code) | | This interface represents the basic needs of a dataobject, namely to
add, update and delete itself, set it's own fields, and deal with things
accordingly
It is currently considered BETA
code at this time. It's intention is to provide a refactoring launching point. Until
then it is recommended that by and large you use the DBObject class directly
unless there is a specific feature that the DataObject interface provides that
you need. However, be forewarned that the interface will change. For example,
Exceptions will eventually be refactored from DBExceptions to DataExceptions.
author: Michael Rimov since: Expresso 5.0 |
Field Summary | |
final static String | STATUS_CURRENT Status constant indicating that this dbobject currently reflects what's
in the database back end. | final static String | STATUS_DELETED Status indicating that this DBObject has been deleted. | final static String | STATUS_NEW Constant describing that this dbobject is new. | final static String | STATUS_UPDATED Status constant indicating that this dbobject has been modified and
does not match the back-end database. |
STATUS_CURRENT | final static String STATUS_CURRENT(Code) | | Status constant indicating that this dbobject currently reflects what's
in the database back end.
|
STATUS_DELETED | final static String STATUS_DELETED(Code) | | Status indicating that this DBObject has been deleted.
|
STATUS_NEW | final static String STATUS_NEW(Code) | | Constant describing that this dbobject is new.
|
STATUS_UPDATED | final static String STATUS_UPDATED(Code) | | Status constant indicating that this dbobject has been modified and
does not match the back-end database.
|
checkField | void checkField(String fieldName, String fieldValue) throws DBException(Code) | | Check that a given value is valid for a given field.
This method is overriden by specific DBObjects to do their own field-level
validations - they should also call super in order to do the
standard stuff. Every field is automatically checked by this method before the
database is updated.
Parameters: fieldName - Name of the field to verify Parameters: fieldValue - Value of the field to be evaluated throws: DBException - If the value is not valid |
count | int count() throws DBException(Code) | | Just like find, but only retrieves the count, not the records themselves.
integer Count of the records matching the criteria throws: DBException - If the search could not be completed |
equals | boolean equals(Object otherObject)(Code) | | Checks to see if two data objects are equal. This is extremely important
in conflict resolution.
Parameters: otherObject - the other object to compare to. true if the two objects are considered equal |
find | boolean find() throws DBException(Code) | | Finds a single record based upon the criteria specified by the DataTransferObject
boolean true if a record was found, and the criteria parameteris filled with the first data object found. throws: DBException - upon error performing the search |
get | Object get(String fieldName) throws DataException(Code) | | Directly gets the DataField Data without having to deal with the DataField
itself
Parameters: fieldName - the name of the field to get Object or null. |
getAllAttributes | Map getAllAttributes()(Code) | | Returns a Read Only Map containing all the current attributes set
for this particular data object instance.
Read Only java.util.Map |
getAttribute | Object getAttribute(String attributeName)(Code) | | Return an "attribute". Attributes are temporary (e.g. not stored in the DBMS)
values associated with this particular DB object instance.
Parameters: attributeName - The attribute name to check the object associated with this attribute |
getDataField | DataField getDataField(String fieldName) throws DBException(Code) | | Returns the object embedded within the field keyed by the fieldName
parameter. The DataField object maintains metadata and other key items
about the field. Its state should not be messed with by the typical program.
Parameters: fieldName - The name of the field to get The object if it isn't null for the data value or null. throws: DBException - upon error |
getExecutor | DataExecutorInterface getExecutor()(Code) | | Use this function to acquire the Executor interface that is associated
with this data object
DataExecutorInterface or null if no Executor has been associatedwith this object |
getFieldMetaData | DataFieldMetaData getFieldMetaData(String fieldName)(Code) | | Retrieves the metadata for a particular field name
Parameters: fieldName - The name of the field to retrieve the metadata for. <\u0441ode>DataFieldMetaData the metadata associated with thisfield. throws: IllegalArgumentException - if the fieldName does not exist. |
getGlobalMask | Pattern getGlobalMask()(Code) | | Retrieve the DBObject's current global mask
String |
getMappedDataContext | String getMappedDataContext()(Code) | | Returns the name of the physical database that we're talking with. This
is opposed to getDataContext() which returns the security context as well.
getMappedDataContext() is strictly used to get at the low level database
connection.
java.lang.String... the context we've mapped to. |
getMaxRecords | int getMaxRecords()(Code) | | A DB Object can be told to only retrieve a certain number of records. If a
"max records" value has been specified, this method provides access to it.
The maximum number of records that should be retrieved, or zeroif no max has been set |
getMetaData | DataObjectMetaData getMetaData()(Code) | | Retrieve the database object's metadata. Metadata is a description of the
database object, so it contains static information such as as description,
field names, field types. Etc.
For implementers of this interface: It is best to store the metadata
somewhere rather than recreating it each and every time. For low-memory
requirements, a WeakHashMap is recommended
a built DataObjectMetaData for this database object |
getOffsetRecord | int getOffsetRecord()(Code) | | Gets the number of records that be skipped. The offset records.
A DB Object can be told to skip a certain number of
records, before reading records from the ResultSet .
author Peter Pilgrim, Thu Jun 21 10:30:59 BST 2001
The maximum number of records that should beskipped over before reading the data records. See Also: DataObject.setOffsetRecord(int) |
getQueryInterface | DataQueryInterface getQueryInterface()(Code) | | Use this function to acquire the DataQueryInterface that is associated
with this data object [Currently unsupported]
DataQueryInterface or null if no QueryInterface has beenassociated with this object |
getStatus | String getStatus()(Code) | | Retrieve the status code of the dataobject.
java.lang.String |
getValidValuesList | java.util.List getValidValuesList(String fieldName) throws DBException(Code) | | Retrieve a list of valid value object for this particular dbobject
Parameters: fieldName - name of the field to retrieve the list for. java.util.List of valid values throws: DBException - upon error |
isGlobalMasked | boolean isGlobalMasked()(Code) | | Return boolean if the data object has a mask set
True if the data object mask is set, else false if it is not |
searchAndRetrieveList | ArrayList searchAndRetrieveList(String sortOrder) throws DBException(Code) | | Performs a datasource search so that the criteria set in the DataObject
is used.
Parameters: sortOrder - A pipe delimited string specifying the field(s) to be sorted upon.May be a single field without any pipes. java.util.List of objects. May be an empty list if noobjects were found. throws: DBException - upon error performing the search |
searchAndRetrieveList | ArrayList searchAndRetrieveList() throws DBException(Code) | | Performs a datasource search so that the criteria set in the DataObject
is used. There is no specified sort order for this version of the method
java.util.List of objects. May be an empty list if noobjects were found. throws: DBException - upon error performing the search |
set | void set(String fieldName, Object o) throws DataException(Code) | | Directly sets the field value without getting the datafield object
Parameters: fieldName - the name of the field to set Parameters: o - the object value to set it to. |
setAttribute | void setAttribute(String attributeName, Object attributeValue)(Code) | | Set an attribute. Attributes are temporary (e.g. not stored in the DBMS) values
associated with this particular DB object instance.
Parameters: attributeName - The name of the attribute being defined Parameters: attributeValue - The object to store under this attribute name |
setFieldsWithDefaults | void setFieldsWithDefaults() throws DataException(Code) | | Sets the fields of this object with the default values defined in
the metadata. The behavior of this function is such that it only
populates fields if there is no current value set. This is
the same behavior that existed previously in DefaultAutoElement.
throws: DataException - upon setField error. since: Expresso 5.6 |
setGlobalMask | void setGlobalMask(Pattern newGlobalMask)(Code) | | Sets the DataObject's global mask
Parameters: newGlobalMask - the New global mask object |
setLocale | void setLocale(java.util.Locale newLocale)(Code) | | Sets the DataObject's locale
Parameters: newLocale - the New locale object |
setMaxRecords | void setMaxRecords(int newMax) throws DBException(Code) | | Specify a maximum number of records to be retrieved in any subsequent
searchAndRetrieve() call. Records will be retrieved (in the specified
sort order) until the specified maximum is reached, then the remainder
of the result set is discarded. Specifying zero indicates that all
records are to be retrieved.
Parameters: newMax - The maximum number of records to retrieve. throws: DBException - If the max number is less than 0 |
setOffsetRecord | void setOffsetRecord(int newOffset) throws DBException(Code) | | Specifies the number of records that should be skipped over
before any data from the ResultSet
is retrieved in any subsequent
searchAndRetrieve() call. Records will be skipped over (in the specified
sort order) until the record counts is equal to or greater
than the offset record. Specifying zero indicates that no
records should be skipped over and the
ResultSet immediately from the start.
Parameters: newOffset - The maximum number of records to retrieve. throws: DBException - If the max number is less than 0author Peter Pilgrim |
setStatus | void setStatus(String statusValue)(Code) | | Sets the status of the object.
Parameters: statusValue - the new status code. |
update | void update() throws DBException(Code) | | Updates the record to the defined datasource
|
|
|
|