Package org.apache.empire.data
Interface Record
- All Superinterfaces:
RecordData
- All Known Implementing Classes:
BeanRecordProxy,DBRecord,DBRecordBase,DBRecordBean,TRecord
The record interface provides methods used for updating data.
A object implementing the record interface is essentially a so called "dynamic bean".
This interface inherits from RecordData which provides further data access methods.
The Record interface is implemented by the class DBRecordBase
-
Method Summary
Modifier and TypeMethodDescriptiongetColumn(int index) Overridden to change return type from ColumnExpr to ColumnReturns the entity this Record belongs togetFieldOptions(Column column) returns the Options list for the given record field.Object[]getKey()returns an array of key values which uniquely identify the record.Column[]returns an array of key columns which uniquely identify the record.booleanisFieldReadOnly(Column column) returns true if the field is read-only.booleanisFieldRequired(Column column) returns true if the field is required.booleanisFieldVisible(Column column) returns true if the field is visible to the client.booleanreturns true if the record has been modified.booleanisNew()returns true if this record is a new record.booleanreturns true if this record is readOnly.booleanisValid()returns true if the record is valid.static Object[]varArgs to Arraysets a record value based on a column.intsetRecordValues(Object bean) sets all record values from a particular bean.intsetRecordValues(Object bean, Collection<Column> ignoreList) sets all record values from a particular bean.voidsets a record value based on the field index.validateValue(Column column, Object value) Validates a value before it is set in the record.booleanwasModified(Column column) checks whether or not the field for the given column has been modified since it has been loaded.Methods inherited from interface org.apache.empire.data.RecordData
get, get, getFieldCount, getFieldIndex, getFieldIndex, getValue, getValue, isNull, isNull, setBeanProperties
-
Method Details
-
key
varArgs to Array- Parameters:
values- the list of key values- Returns:
- the record key
-
isValid
boolean isValid()returns true if the record is valid.- Returns:
- true if the record is valid
-
isReadOnly
boolean isReadOnly()returns true if this record is readOnly.- Returns:
- true if this record is readOnly
-
isModified
boolean isModified()returns true if the record has been modified.- Returns:
- true if the record has been modified or false otherwise
-
isNew
boolean isNew()returns true if this record is a new record.- Returns:
- true if this record is a new record
-
getColumn
Overridden to change return type from ColumnExpr to Column- Specified by:
getColumnin interfaceRecordData- Parameters:
index- field index of the column expression- Returns:
- the column expression object or null if the index is out of range
-
getKeyColumns
Column[] getKeyColumns()returns an array of key columns which uniquely identify the record.- Returns:
- the array of key columns if any
-
getKey
Object[] getKey()returns an array of key values which uniquely identify the record.- Returns:
- the key value array
-
getEntity
Entity getEntity()Returns the entity this Record belongs to- Returns:
- the entity
-
isFieldVisible
returns true if the field is visible to the client.- Parameters:
column- the column to check for visibility- Returns:
- true if the field is visible to the client
-
isFieldReadOnly
returns true if the field is read-only.- Parameters:
column- the requested column- Returns:
- true if the field is read-only
-
isFieldRequired
returns true if the field is required.- Parameters:
column- the requested column- Returns:
- true if the field is required
-
getFieldOptions
returns the Options list for the given record field.- Parameters:
column- the column to check for visibility- Returns:
- an options collection containing all allowed field values
-
setValue
sets a record value based on the field index.- Parameters:
i- index of the field for which to set the valuevalue- the new field value
-
set
sets a record value based on a column.- Parameters:
column- the requested columnvalue- the new record value for the given column- Returns:
- the record (this)
-
validateValue
Validates a value before it is set in the record. By default, this method simply calls column.validate()- Parameters:
column- the columnvalue- the value to validate- Returns:
- the value
-
wasModified
checks whether or not the field for the given column has been modified since it has been loaded.- Parameters:
column- the requested column- Returns:
- Returns true if a column has been modified
-
setRecordValues
sets all record values from a particular bean.The bean must provide corresponding getter functions for all desired column.
In order to map column names to property names the property name is detected by ColumnExpr.getBeanPropertyName()
- Parameters:
bean- the Java Bean from which to read the value fromignoreList- list of column to ignore- Returns:
- the number of fields that have been set
-
setRecordValues
sets all record values from a particular bean.The bean must provide corresponding getter functions for all desired column.
- Parameters:
bean- the Java Bean from which to read the value from- Returns:
- the number of fields that have been set
-