|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sptci.echo.binding.Updater<V,M>
com.sptci.echo.binding.ModelUpdater<V,M>
com.sptci.echo.binding.JDOModelUpdater<V,M>
V - The class name of the view component from which data is read.M - The class name of the model object that is to be updated.public class JDOModelUpdater<V,M extends JDOObject>
An updater used to update JavaBean objects from
their associated UI containers. Adds JDO specific
actions such as making modifications within the
bounds of a transaction.
The following shows sample use of this updater:
import com.sptci.echo.binding.JDOModelUpdater;
...
// If persisting new instances to data store
Bean bean = new Bean();
bean.setName( "name" );
bean.setDescription( "my name" );
View view = new View( bean );
// bind view from model and let user interact
JDOModelUpdater updater = new JDOModeUpdater( view, bean );
updater.update();
...
// If updating persistent instances.
Bean bean = BeanFactory.fetch( "name", pm );
View view = new View( bean );
// bind view from model and let user interact
JDOModelUpdater updater = new JDOModelUpdater( view, bean );
updater.update();
Copyright 2006 Sans Pareil Technologies, Inc.
| Field Summary | |
|---|---|
protected boolean |
active
A flag used to indicate whether a transaction is active or not with the pm. |
protected JDOApplication |
app
The global application instance for the user session. |
| Fields inherited from class com.sptci.echo.binding.Updater |
|---|
bean, logger, view |
| Constructor Summary | |
|---|---|
JDOModelUpdater(V view,
M bean)
Create a new instance with the specified UI container and java bean. |
|
| Method Summary | |
|---|---|
protected void |
begin()
Initialise pm and start a transaction if
necessary. |
protected void |
commit()
Commit an existing trasaction associated with the pm if appropriate. |
protected Object |
getRepository()
Fetch the repository instance to use to manage Updater.bean. |
protected void |
persist()
Persist the Updater.bean to the data store. |
protected void |
rollback()
Rollback the current transaction in case errors were encountered while interacting with the data store. |
void |
update()
Over-ridden to conduct the updates with the bounds of a transaction as mandated by JDO. |
| Methods inherited from class com.sptci.echo.binding.ModelUpdater |
|---|
getFieldName, processCollection, updateField |
| Methods inherited from class com.sptci.echo.binding.Updater |
|---|
beanValues, getBean, getView, setBean, setView, viewValues |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final JDOApplication app
protected boolean active
pm.
| Constructor Detail |
|---|
public JDOModelUpdater(V view,
M bean)
view - The Updater.view to use.bean - The Updater.bean to use.| Method Detail |
|---|
public void update()
update in class ModelUpdater<V,M extends JDOObject>BindingException - If errors are encountered while
accessing or setting the fields.begin(),
ModelUpdater.update(),
persist()protected void begin()
pm and start a transaction if
necessary.
protected void persist()
throws BindingException
Updater.bean to the data store. Invokes the
save method on an associated repository class for Updater.bean or directly on pm.
BindingException - If errors are encountered while introspecting
the repository.getRepository()protected void commit()
pm if appropriate.
protected void rollback()
protected Object getRepository()
throws ClassNotFoundException,
Throwable
Updater.bean.
ClassNotFoundException - If the repository does not exist
Throwable - If other reflection errors are encountered.
|
SPT Core API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||