java.lang.Object
edu.internet2.middleware.grouper.ext.org.apache.ddlutils.dynabean.DynaClassCache

public class DynaClassCache extends Object
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 Details

    • DynaClassCache

      public DynaClassCache()
  • Method Details

    • createNewInstance

      public org.apache.commons.beanutils.DynaBean createNewInstance(Table table) throws SqlDynaException
      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 for
      source - Either a bean, a Map 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

      public SqlDynaClass getDynaClass(Table table)
      Returns the SqlDynaClass 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 the SqlDynaClass for the given bean.
      Parameters:
      dynaBean - The bean
      Returns:
      The dyna bean class
      Throws:
      SqlDynaException