Class DynaClassCache
java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.dynabean.DynaClassCache
Provides a cache of dyna class instances for a specific model, as well as
helper methods for dealing with these classes.
- Version:
- $Revision: 231110 $
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.commons.beanutils.DynaBean
Creates a new dyna bean instance for the given table and copies the values from the given source object.org.apache.commons.beanutils.DynaBean
createNewInstance
(Table table) Creates a new dyna bean instance for the given table.getDynaClass
(Table table) Returns theSqlDynaClass
for the given table.getDynaClass
(org.apache.commons.beanutils.DynaBean dynaBean) Returns theSqlDynaClass
for the given bean.
-
Constructor Details
-
DynaClassCache
public DynaClassCache()
-
-
Method Details
-
createNewInstance
Creates a new dyna bean instance for the given table.- Parameters:
table
- The table- Returns:
- The new empty dyna bean
- Throws:
SqlDynaException
-
copy
public org.apache.commons.beanutils.DynaBean copy(Table table, Object source) throws SqlDynaException Creates a new dyna bean instance for the given table and copies the values from the given source object. The source object can be a bean, a map or a dyna bean. This method is useful when iterating through an arbitrary dyna bean result set after performing a query, then creating a copy as a DynaBean which is bound to a specific table. This new DynaBean can be kept around, changed and stored back into the database.- Parameters:
table
- The table to create the dyna bean forsource
- Either a bean, aMap
or a dyna bean that will be used to populate the resultint dyna bean- Returns:
- A new dyna bean bound to the given table and containing all the properties from the source object
- Throws:
SqlDynaException
-
getDynaClass
Returns theSqlDynaClass
for the given table. If the it does not exist yet, a new one will be created based on the Table definition.- Parameters:
table
- The table- Returns:
- The
SqlDynaClass
for the indicated table
-
getDynaClass
public SqlDynaClass getDynaClass(org.apache.commons.beanutils.DynaBean dynaBean) throws SqlDynaException Returns theSqlDynaClass
for the given bean.- Parameters:
dynaBean
- The bean- Returns:
- The dyna bean class
- Throws:
SqlDynaException
-