net.xoetrope.optional.data.pojo
Class XPojoHibernateModel

java.lang.Object
  extended by net.xoetrope.xui.data.XModel
      extended by net.xoetrope.optional.data.pojo.XPojoModel
          extended by net.xoetrope.optional.data.pojo.XPojoHibernateModel

public class XPojoHibernateModel
extends XPojoModel


Field Summary
 
Fields inherited from class net.xoetrope.optional.data.pojo.XPojoModel
adapter, collectionElements, dataSource, dirty, elIdx, getter, getterArgValues, pojo, properties, propertyName, setter
 
Fields inherited from class net.xoetrope.xui.data.XModel
parentModel, tagName
 
Constructor Summary
protected XPojoHibernateModel(XModel parent, java.lang.Object pojo, XPojoDataSource ds)
          Creates a new instance of XPojoHibernateModel
protected XPojoHibernateModel(XModel parent, java.lang.String subPath, XPojoDataSource ds)
          Creates a new instance of XPojoHibernateModel
 
Method Summary
 void delete()
          Removes the underlying pojo from the persistent context, removes its persistent state.
protected  java.lang.Object executeGetter(XPojoModel childNode)
          Gets the value returned by the specified getter method call.
protected  void executeSetter(XPojoModel childNode, java.lang.Object value)
          Executes the setter method of the given model node
 void saveOrUpdate()
          Persists the underlying pojo.
 
Methods inherited from class net.xoetrope.optional.data.pojo.XPojoModel
append, append, clear, copyTo, get, get, get, getAttribName, getAttribute, getAttribValue, getAttribValueAsDouble, getAttribValueAsDouble, getAttribValueAsInt, getAttribValueAsString, getCollectionElements, getDataSource, getElIdx, getGetter, getGetterArguments, getId, getNumAttributes, getNumChildren, getPojo, getPropertyName, getPropertyValue, getSetter, getValueAsDouble, getValueAsInt, getValueAsString, hasAutoId, hashCode, hasTransientAncestestor, isCollection, isDirty, isPropertyTransient, isTransient, markSubtreeAsDirty, retrieveModelNode, saveModelNode, set, set, setAttribValue, setAttribValue, setDirty, setGetter, setId, setNumChildren, setPojo, setPropertyValue, setSetter, sync
 
Methods inherited from class net.xoetrope.xui.data.XModel
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

XPojoHibernateModel

protected XPojoHibernateModel(XModel parent,
                              java.lang.String subPath,
                              XPojoDataSource ds)
Creates a new instance of XPojoHibernateModel

Parameters:
parent - the parent model node
subPath - String in the format: propertyName(property arguments)[collection idx] as it appears in a binding path
ds - the data source object

XPojoHibernateModel

protected XPojoHibernateModel(XModel parent,
                              java.lang.Object pojo,
                              XPojoDataSource ds)
Creates a new instance of XPojoHibernateModel

Parameters:
parent - the parent model node
object - the underlying pojo
ds - the data source object
Method Detail

executeSetter

protected void executeSetter(XPojoModel childNode,
                             java.lang.Object value)
                      throws java.lang.Exception
Executes the setter method of the given model node

Overrides:
executeSetter in class XPojoModel
Parameters:
childNode - the model node whose getter is to be called
value - the object to be passed as an argument to the setter call
Throws:
java.lang.Exception

executeGetter

protected java.lang.Object executeGetter(XPojoModel childNode)
                                  throws java.lang.Exception
Gets the value returned by the specified getter method call.

Overrides:
executeGetter in class XPojoModel
Parameters:
childNode - the model node whose getter is to be called.
Returns:
object returned by the getter method call.
Throws:
java.lang.Exception

saveOrUpdate

public void saveOrUpdate()
Persists the underlying pojo.


delete

public void delete()
Removes the underlying pojo from the persistent context, removes its persistent state.