org.formaria.data.pojo
Class HibernatePojoModel

java.lang.Object
  extended by org.formaria.aria.data.DataModel
      extended by org.formaria.data.pojo.PojoModel
          extended by org.formaria.data.pojo.PersistentPojoModel
              extended by org.formaria.data.pojo.HibernatePojoModel

public class HibernatePojoModel
extends PersistentPojoModel

A model node for interacting with Hibernate 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 HibernatePojoModel(DataModel parent, java.lang.Object pojo, PojoDataSource ds)
          Creates a new instance of HibernatePojoModel
  HibernatePojoModel(DataModel parent, java.lang.String subPath, PojoDataSource ds)
          Creates a new instance of HibernatePojoModel
 
Method Summary
protected  boolean getterRequiresTransaction(PojoModel childNode)
          Check if an active transaciton is required before invoking a getter method that is used to obtain the POJO stored in the specified 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.PersistentPojoModel
delete, evict, getPropertyValue, lock, merge, persist, setPropertyValue
 
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

HibernatePojoModel

public HibernatePojoModel(DataModel parent,
                          java.lang.String subPath,
                          PojoDataSource ds)
Creates a new instance of HibernatePojoModel

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

HibernatePojoModel

protected HibernatePojoModel(DataModel parent,
                             java.lang.Object pojo,
                             PojoDataSource ds)
Creates a new instance of HibernatePojoModel

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

getterRequiresTransaction

protected boolean getterRequiresTransaction(PojoModel childNode)
Check if an active transaciton is required before invoking a getter method that is used to obtain the POJO stored in the specified model node

Overrides:
getterRequiresTransaction in class PersistentPojoModel
Parameters:
childNode - the POJO model node whose getter is to be queried
Returns:
true if an active transaction is required, false otherwise

setterRequiresTransaction

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

Overrides:
setterRequiresTransaction in class PersistentPojoModel
Parameters:
childNode - the POJO model node whose setter is to be queried
value - the value of the setter argument
Returns:
true if an active transactio is required, false otherwise