|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.formaria.aria.data.DataModel
org.formaria.data.pojo.PojoModel
org.formaria.data.pojo.PersistentPojoModel
public class PersistentPojoModel
A model node for interacting with persistent POJOs
Copyright (c) Formaria Ltd., 2008
License: see license.txt
| Field Summary |
|---|
| Fields inherited from class org.formaria.data.pojo.PojoModel |
|---|
adapter, collectionElements, dataSource, dirty, elIdx, getterArgTypes, getterArgValues, pojo, properties, propertyKey, propertyName |
| Fields inherited from class org.formaria.aria.data.DataModel |
|---|
parentModel, tagName |
| Constructor Summary | |
|---|---|
protected |
PersistentPojoModel(DataModel parent,
java.lang.Object pojo,
PojoDataSource ds)
Creates a new instance of PersistentPojoModel |
protected |
PersistentPojoModel(DataModel parent,
java.lang.String subPath,
PojoDataSource ds)
Creates a new instance of PersistentPojoModel |
| Method Summary | |
|---|---|
void |
delete()
Deletes the underlying POJO from the datastore, removes it from the persistent context. |
void |
evict()
Removes the underlying POJO from the persistent context, this method doesn't result in any changes in the datastore. |
protected java.lang.Object |
getPropertyValue(PojoModel childNode)
Gets the value returned by the specified getter method call. |
protected boolean |
getterRequiresTransaction(PojoModel childNode)
Check if an active transaction is requires before invoking a getter method that is used to obtain the POJO stored in the specified model node |
void |
lock()
Reassociates the encapsulated POJO with a session. |
void |
merge()
Copies the state of the underlying POJO onto the persistent object with the same identifier and then sets the persistent object as the underlying POJO. |
void |
persist()
Persists the underlying POJO. |
protected void |
setPropertyValue(PojoModel childNode,
java.lang.Object value)
Executes the setter method of the given model node |
protected boolean |
setterRequiresTransaction(PojoModel childNode,
java.lang.Object value)
Check if an active transaction is required before invoking a setter method that is used to obtain the POJO stored in the specified model node |
| Methods inherited from class org.formaria.data.pojo.PojoModel |
|---|
append, append, clear, get, get, get, getAttribName, getAttribute, getAttribValue, getAttribValueAsDouble, getAttribValueAsDouble, getAttribValueAsInt, getAttribValueAsString, getCollectionElements, getDataSource, getElIdx, getGetterArgTypes, getGetterArgValues, getId, getNumAttributes, getNumChildren, getPojo, getPropertyKey, getPropertyName, getValueAsDouble, getValueAsInt, getValueAsString, hasAutoId, hashCode, hasSetter, isAlwaysDirty, isCollection, isDirty, isTransient, isTransient, markSubtreeAsAlwaysDirty, markSubtreeAsDirty, retrieveModelNode, saveModelNode, set, set, setAlwaysDirty, setAttribValue, setAttribValue, setDirty, setId, setNumChildren, setPojo, sync |
| Methods inherited from class org.formaria.aria.data.DataModel |
|---|
addModelListener, fireModelUpdated, getParent, getTagName, hasAutoId, prefixOutputPath, removeChildren, reset, resetAttributes, setNumAttributes, setParent, setTagName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected PersistentPojoModel(DataModel parent,
java.lang.String subPath,
PojoDataSource ds)
parent - the parent model nodesubPath - String in the format:
propertyName(property arguments)[collection idx]
as it appears in a binding pathds - the data source object.
protected PersistentPojoModel(DataModel parent,
java.lang.Object pojo,
PojoDataSource ds)
parent - the parent model nodeds - the data source object.| Method Detail |
|---|
protected boolean getterRequiresTransaction(PojoModel childNode)
childNode - the POJO model node whose getter is to be queried
protected boolean setterRequiresTransaction(PojoModel childNode,
java.lang.Object value)
childNode - the POJO model node whose setter is to be queriedvalue - the value of the setter argument
protected void setPropertyValue(PojoModel childNode,
java.lang.Object value)
setPropertyValue in class PojoModelchildNode - the model node whose getter is to
be invokedvalue - the object to be passed as an argument to the setter callprotected java.lang.Object getPropertyValue(PojoModel childNode)
getPropertyValue in class PojoModelchildNode - the model node whose getter is to
be called.
public void persist()
public void merge()
public void lock()
public void delete()
public void evict()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||