org.formaria.data.pojo
Class PersistentPojoAdapter

java.lang.Object
  extended by org.formaria.registry.ComponentAdapter
      extended by org.formaria.registry.ReflectionAdapter
          extended by org.formaria.data.pojo.PojoAdapter
              extended by org.formaria.data.pojo.PersistentPojoAdapter

public class PersistentPojoAdapter
extends PojoAdapter

An adapter for Persistent POJO's mapping the Aria model's use of the POJO, including customizations specified by the datasourec configuration to the interface provided by the POJO.

Copyright (c) Formaria Ltd., 2008
License: see license.txt


Field Summary
protected  java.util.Hashtable getterTransactions
           
protected  boolean isDao
           
protected  java.util.Hashtable setterTransactions
           
 
Fields inherited from class org.formaria.data.pojo.PojoAdapter
dataSource, GETTER_PREFIXES, SETTER_PREFIXES, transientProperties
 
Fields inherited from class org.formaria.registry.ComponentAdapter
className, clazz, getters, setters, UI
 
Constructor Summary
PersistentPojoAdapter(java.lang.Class clazz, PersistentPojoDataSource ds)
          Creates a new instance of PersistentPojoAdapter
 
Method Summary
protected  boolean getterRequiresTransaction(PojoModel childNode)
          Indicates whether the property getter requires an active transaction
protected  boolean isDao()
          Indicates whether the class being adapted by this object is a Data Access Object.
protected  void setDao(boolean state)
          Marks that the adapted class is or isn't a Data Access Object
protected  void setGetterTransaction(java.lang.String propertyName, java.lang.String getterSig)
          Marks that the invocation of the specified getter method must be done within an open persistent context.
protected  void setSetterTransaction(java.lang.String propertyName, java.lang.String sig)
          Marks that the invocation of the specified setter must be done within an open persitent context.
protected  boolean setterRequiresTransaction(PojoModel childNode, java.lang.Object value)
          Indicates whether the property setter requires an active transaction
protected  void unsetGetterTransaction(java.lang.String propertyName, java.lang.String getterSig)
          Marks that the invocation of the specified getter doesn't require an open persistent context
protected  void unsetSetterTransaction(java.lang.String propertyName, java.lang.String sig)
          Marks that the invocation of the specified getter doesn't require an open persistent context
 
Methods inherited from class org.formaria.data.pojo.PojoAdapter
customizeProperty, findFirstMethod, getGetter, getId, getSetter, getSetter, getSetter, invoke, isTransient, setTransient
 
Methods inherited from class org.formaria.registry.ReflectionAdapter
addProperty, getProperty, setProperty
 
Methods inherited from class org.formaria.registry.ComponentAdapter
addProperty, getAdapterClass, getAdapterClassName, getUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

getterTransactions

protected java.util.Hashtable getterTransactions

setterTransactions

protected java.util.Hashtable setterTransactions

isDao

protected boolean isDao
Constructor Detail

PersistentPojoAdapter

public PersistentPojoAdapter(java.lang.Class clazz,
                             PersistentPojoDataSource ds)
Creates a new instance of PersistentPojoAdapter

Parameters:
clazz - the class to be adapted
ds - the data source object
Method Detail

isDao

protected boolean isDao()
Indicates whether the class being adapted by this object is a Data Access Object.


setDao

protected void setDao(boolean state)
Marks that the adapted class is or isn't a Data Access Object


setGetterTransaction

protected void setGetterTransaction(java.lang.String propertyName,
                                    java.lang.String getterSig)
Marks that the invocation of the specified getter method must be done within an open persistent context.

Parameters:
propertyName - the name of the property to which the getter is assigned
getterSig - the getter method signature

unsetGetterTransaction

protected void unsetGetterTransaction(java.lang.String propertyName,
                                      java.lang.String getterSig)
Marks that the invocation of the specified getter doesn't require an open persistent context

Parameters:
propertyName - the name of the property to which the getter is assigned
getterSig - the getter method signature

setSetterTransaction

protected void setSetterTransaction(java.lang.String propertyName,
                                    java.lang.String sig)
Marks that the invocation of the specified setter must be done within an open persitent context.

Parameters:
propertyName - the name of the property to which the setter is assigned.
setterSig - the setter method signature

unsetSetterTransaction

protected void unsetSetterTransaction(java.lang.String propertyName,
                                      java.lang.String sig)
Marks that the invocation of the specified getter doesn't require an open persistent context

Parameters:
propertyName - the name of the property to which the getter is assigned
getterSig - the getter method signature

getterRequiresTransaction

protected boolean getterRequiresTransaction(PojoModel childNode)
Indicates whether the property getter requires an active transaction

Parameters:
propertyName - the name of the property whose getter is to be queried
argTypes - the getter argument types
Returns:
true if the specified getter exists and requires an active transaction, false otherwise

setterRequiresTransaction

protected boolean setterRequiresTransaction(PojoModel childNode,
                                            java.lang.Object value)
Indicates whether the property setter requires an active transaction

Parameters:
propertyName - the name of the property whose setter is to be queried
argTypes - the setter argument types, this should be a table containing one Class object.
Returns:
true if the specified setter exists and requires an active transaction, false otherwise