org.apache.empire.jsf2.pageelements
Class RecordPageElement<T extends DBRecord>

java.lang.Object
  extended by org.apache.empire.jsf2.pages.PageElement
      extended by org.apache.empire.jsf2.pageelements.RecordPageElement<T>
All Implemented Interfaces:
Serializable

public class RecordPageElement<T extends DBRecord>
extends PageElement

See Also:
Serialized Form

Field Summary
protected  T record
           
protected  DBRowSet rowset
           
 
Constructor Summary
RecordPageElement(Page page, DBRowSet rowset, T record, String propertyName)
           
 
Method Summary
 boolean canReloadRecord(boolean newRecord)
          return true if the record can be restored from the session.
 void closeRecord()
          closes a record
 void createRecord()
          creates a new record
 void deleteRecord()
          deletes a record
 T getRecord()
           
 String getRecordIdParam()
           
 DBRowSet getRowSet()
           
 void loadRecord(Object[] recKey)
          loads the record identified by the supplied key from the database
 void loadRecord(String idParam)
          loads an existing record
protected  void onInitPage()
           
 void reloadRecord()
          loads the record identified by the supplied key from the database
 boolean updateRecord()
          updates or inserts the record in the database
 
Methods inherited from class org.apache.empire.jsf2.pages.PageElement
getConnection, getConnection, getPage, getPropertyName, getSessionObject, onRefreshPage, removeSessionObject, setSessionObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rowset

protected DBRowSet rowset

record

protected T extends DBRecord record
Constructor Detail

RecordPageElement

public RecordPageElement(Page page,
                         DBRowSet rowset,
                         T record,
                         String propertyName)
Method Detail

getRecord

public T getRecord()

getRowSet

public DBRowSet getRowSet()

getRecordIdParam

public String getRecordIdParam()

onInitPage

protected void onInitPage()
Overrides:
onInitPage in class PageElement

canReloadRecord

public boolean canReloadRecord(boolean newRecord)
return true if the record can be restored from the session.

Parameters:
newRecord - flag to detect session data for a new reaord otherwise for an existing record
Returns:
true if information to restore the record is available on the session

reloadRecord

public void reloadRecord()
loads the record identified by the supplied key from the database


loadRecord

public void loadRecord(Object[] recKey)
loads the record identified by the supplied key from the database


loadRecord

public void loadRecord(String idParam)
loads an existing record

Parameters:
idParam -

createRecord

public void createRecord()
creates a new record


updateRecord

public boolean updateRecord()
updates or inserts the record in the database


deleteRecord

public void deleteRecord()
deletes a record


closeRecord

public void closeRecord()
closes a record



Copyright © 2008–2014 Apache Software Foundation. All rights reserved.