public class RecordActionSupport extends RecordFormActionSupport
This class provides functions for form data processing for a given Table or View (DBRowSet).
The record object provided with the constructor will be used to obtain further context specific metadata
such as field options (getFieldOptions) and field accessibility (isFieldReadOnly).
The record object should initially be invalid and not attached to any Table or View (DBRowSet).
Modifier and Type | Class and Description |
---|---|
static class |
RecordActionSupport.SessionPersistance
Deprecated.
|
Modifier and Type | Field and Description |
---|---|
protected static org.slf4j.Logger |
log |
protected DBRecord |
record |
protected DBRowSet |
rowset |
persistence
action, propertyName
Constructor and Description |
---|
RecordActionSupport(ActionBase action,
DBRowSet rowset,
DBRecord record,
RecordActionSupport.SessionPersistance persistence)
Deprecated.
|
RecordActionSupport(ActionBase action,
DBRowSet rowset,
DBRecord record,
RecordActionSupport.SessionPersistance persistence,
String propertyName)
Deprecated.
|
RecordActionSupport(ActionBase action,
DBRowSet rowset,
DBRecord record,
SessionPersistence persistence) |
RecordActionSupport(ActionBase action,
DBRowSet rowset,
DBRecord record,
SessionPersistence persistence,
String propertyName) |
Modifier and Type | Method and Description |
---|---|
void |
closeRecord()
Closes the record and releases any allocated session objects
|
boolean |
createRecord()
creates a new record.
Depending on the persistence setting the record key or the record data will be stored on the session. |
boolean |
deleteRecord()
deletes the current record database.
|
boolean |
deleteRecord(Object[] recKey,
boolean newRec)
deletes the record identified by the supplied key from the database.
|
DBRecord |
detachRecord() |
Object[] |
findAnyConflictRecord() |
List<DBIndex> |
findChangedIndexes() |
RecordActionSupport.SessionPersistance |
getPersistance()
Deprecated.
|
DBRecord |
getRecord() |
DBRowSet |
getRowset() |
void |
initReferenceColumns()
sets all required foreign keys for this record.
The foreign key values must be supplied with the request. |
boolean |
isLoadBeforeDelete() |
boolean |
loadFormData()
loads the data from the form into the current record object
|
boolean |
loadFormData(Object[] recKey,
boolean insert)
This function load all form date from the request into the record
for each record column the following steps are taken
1.
|
boolean |
loadRecord()
loads the record either from the supplied item key on the request or from the session.
|
void |
loadRecord(Object[] recKey)
loads the record identified by the supplied key from the database
|
void |
reloadRecord()
reloads the current record from the session.
If persistence is set to Key then the key is obtained from the session and the record is reloaded from the database. |
boolean |
saveChanges()
Updates the record by calling onUpdateRecord and updates the currentKey
The update will not be committed, hence the caller must commit or rollback
the operation
|
void |
setLoadBeforeDelete(boolean loadBeforeDelete) |
protected boolean |
setRecordFieldValue(int i,
Object value,
boolean verify)
overridable: sets the value of single field
|
protected void |
updateRecord(Connection conn)
overridable: onUpdateRecord
|
compareKey, getActionParamKey, getActionParamNewFlag, getPersistence, getRecordFromSession, getRecordKeyString, getRequestFieldName, hasActionKey, isNewRecord, persistOnSession, removeFromSession, setUpdateFields
addFieldError, getActionParam, getRecordPropertyName, isEnableFieldErrors, setEnableFieldErrors
protected static org.slf4j.Logger log
protected DBRowSet rowset
protected DBRecord record
public RecordActionSupport(ActionBase action, DBRowSet rowset, DBRecord record, SessionPersistence persistence, String propertyName)
public RecordActionSupport(ActionBase action, DBRowSet rowset, DBRecord record, SessionPersistence persistence)
@Deprecated public RecordActionSupport(ActionBase action, DBRowSet rowset, DBRecord record, RecordActionSupport.SessionPersistance persistence, String propertyName)
@Deprecated public RecordActionSupport(ActionBase action, DBRowSet rowset, DBRecord record, RecordActionSupport.SessionPersistance persistence)
public DBRecord getRecord()
getRecord
in class RecordFormActionSupport
public DBRowSet getRowset()
public boolean isLoadBeforeDelete()
public void setLoadBeforeDelete(boolean loadBeforeDelete)
@Deprecated public RecordActionSupport.SessionPersistance getPersistance()
public boolean createRecord()
public void initReferenceColumns()
public void loadRecord(Object[] recKey)
public boolean loadRecord()
public void reloadRecord()
public boolean deleteRecord(Object[] recKey, boolean newRec)
recKey
- the record keynewRec
- flag indicating whether it is a new unsaved record.public final boolean deleteRecord()
public boolean loadFormData(Object[] recKey, boolean insert)
public boolean loadFormData()
RecordFormActionSupport
loadFormData
in class RecordFormActionSupport
public boolean saveChanges()
public void closeRecord()
public DBRecord detachRecord()
public final Object[] findAnyConflictRecord()
protected void updateRecord(Connection conn)
protected boolean setRecordFieldValue(int i, Object value, boolean verify)
RecordFormActionSupport
setRecordFieldValue
in class RecordFormActionSupport
Copyright © 2008–2015 Apache Software Foundation. All rights reserved.