org.apache.empire.data
Interface Record

All Superinterfaces:
RecordData
All Known Implementing Classes:
BeanRecordProxy, DBRecord

public interface Record
extends RecordData

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 implmented by the class DBRecord


Method Summary
 Column getColumn(int index)
          returns the column at the specified index.
 Options getFieldOptions(Column column)
          returns the Options list for the given record field.
 Column[] getKeyColumns()
          returns an array of key columns which uniquely identify the record.
 boolean isFieldReadOnly(Column column)
          returns true if the field is read-only.
 boolean isFieldVisible(Column column)
          returns true if the field is visible to the client.
 boolean isModified()
          returns true if the record has been modified.
 boolean isNew()
          returns true if this record is a new record.
 boolean isValid()
          returns true if the record is valid.
 boolean setBeanValues(java.lang.Object bean)
          sets all record values from a particular bean.
 boolean setBeanValues(java.lang.Object bean, java.util.Collection<Column> ignoreList)
          sets all record values from a particular bean.
 boolean setValue(Column column, java.lang.Object value)
          sets a record value based on a column.
 boolean setValue(int i, java.lang.Object value)
          sets a record value based on the field index.
 boolean wasModified(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
getBeanProperties, getBeanProperties, getColumnExpr, getFieldCount, getFieldIndex, getFieldIndex, getValue, getValue, isNull, isNull
 

Method Detail

isValid

boolean isValid()
returns true if the record is valid.

Returns:
true if the record is valid

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

Column getColumn(int index)
returns the column at the specified index.

Parameters:
index - index of a requested column
Returns:
the column on the specified index

getKeyColumns

Column[] getKeyColumns()
returns an array of key columns which uniquely identify the record.

Returns:
the array of key columns if any

isFieldReadOnly

boolean isFieldReadOnly(Column column)
returns true if the field is read-only.

Parameters:
column - the requested column
Returns:
true if the field is read-only

isFieldVisible

boolean isFieldVisible(Column column)
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

getFieldOptions

Options getFieldOptions(Column column)
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

boolean setValue(int i,
                 java.lang.Object value)
sets a record value based on the field index.

Parameters:
i - index of the field for which to set the value
value - the new field value
Returns:
true if value has been set or false if the value cannot be set for this field

setValue

boolean setValue(Column column,
                 java.lang.Object value)
sets a record value based on a column.

Parameters:
column - the requested column
value - the new record value for the given column
Returns:
true if value has been set or false if the value cannot be set for this column

wasModified

boolean wasModified(Column column)
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

setBeanValues

boolean setBeanValues(java.lang.Object bean,
                      java.util.Collection<Column> ignoreList)
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 from
ignoreList - list of column to ignore
Returns:
true if at least one field value has been successfully set

setBeanValues

boolean setBeanValues(java.lang.Object bean)
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:
true if at least one field value has been successfully set


Copyright © 2008-2011 Apache Software Foundation. All Rights Reserved.