org.apache.openjpa.jdbc.kernel
Class AbstractUpdateManager

java.lang.Object
  extended by org.apache.openjpa.jdbc.kernel.AbstractUpdateManager
All Implemented Interfaces:
UpdateManager, org.apache.openjpa.lib.conf.Configurable
Direct Known Subclasses:
ConstraintUpdateManager, OperationOrderUpdateManager

public abstract class AbstractUpdateManager
extends java.lang.Object
implements UpdateManager, org.apache.openjpa.lib.conf.Configurable

Base update manager with common functionality.

Author:
Abe White

Nested Class Summary
protected static class AbstractUpdateManager.CustomMapping
          Executes customized mapping updates.
 
Field Summary
protected  JDBCConfiguration conf
           
protected  DBDictionary dict
           
 
Constructor Summary
AbstractUpdateManager()
           
 
Method Summary
protected  java.util.Collection addException(java.util.Collection exceps, java.lang.Exception err)
          Add the given exception to the given list, which may start out as null.
 void endConfiguration()
           
 java.util.Collection flush(java.util.Collection states, JDBCStore store)
          Flush the given instances to the data store.
protected abstract  java.util.Collection flush(RowManager rowMgr, PreparedStatementManager psMgr, java.util.Collection exceps)
          Flush all rows of the given row manager.
protected abstract  PreparedStatementManager newPreparedStatementManager(JDBCStore store, java.sql.Connection conn)
          Return a new PreparedStatementManager.
protected abstract  RowManager newRowManager()
          Return a new RowManager.
protected  java.util.Collection populateRowManager(org.apache.openjpa.kernel.OpenJPAStateManager sm, RowManager rowMgr, JDBCStore store, java.util.Collection exceps, java.util.Collection customs)
          Populate the row manager with rows to be flushed for the given state.
 void setConfiguration(org.apache.openjpa.lib.conf.Configuration conf)
           
 void startConfiguration()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.openjpa.jdbc.kernel.UpdateManager
orderDirty
 

Field Detail

conf

protected JDBCConfiguration conf

dict

protected DBDictionary dict
Constructor Detail

AbstractUpdateManager

public AbstractUpdateManager()
Method Detail

setConfiguration

public void setConfiguration(org.apache.openjpa.lib.conf.Configuration conf)
Specified by:
setConfiguration in interface org.apache.openjpa.lib.conf.Configurable

startConfiguration

public void startConfiguration()
Specified by:
startConfiguration in interface org.apache.openjpa.lib.conf.Configurable

endConfiguration

public void endConfiguration()
Specified by:
endConfiguration in interface org.apache.openjpa.lib.conf.Configurable

flush

public java.util.Collection flush(java.util.Collection states,
                                  JDBCStore store)
Description copied from interface: UpdateManager
Flush the given instances to the data store.

Specified by:
flush in interface UpdateManager
See Also:
StoreManager.flush(java.util.Collection)

newRowManager

protected abstract RowManager newRowManager()
Return a new RowManager.


newPreparedStatementManager

protected abstract PreparedStatementManager newPreparedStatementManager(JDBCStore store,
                                                                        java.sql.Connection conn)
Return a new PreparedStatementManager.


flush

protected abstract java.util.Collection flush(RowManager rowMgr,
                                              PreparedStatementManager psMgr,
                                              java.util.Collection exceps)
Flush all rows of the given row manager. Add exceptions to exceps (which may start as null) using addException(java.util.Collection, java.lang.Exception). Return exceps.


populateRowManager

protected java.util.Collection populateRowManager(org.apache.openjpa.kernel.OpenJPAStateManager sm,
                                                  RowManager rowMgr,
                                                  JDBCStore store,
                                                  java.util.Collection exceps,
                                                  java.util.Collection customs)
Populate the row manager with rows to be flushed for the given state.

Parameters:
exceps - exceptions encountered when flushing will be added to this list and returned; the list may be null initially
customs - buffer custom mappings
Returns:
the exceptions list

addException

protected java.util.Collection addException(java.util.Collection exceps,
                                            java.lang.Exception err)
Add the given exception to the given list, which may start out as null.