Package org.apache.openjpa.jdbc.kernel
Class AbstractUpdateManager
- java.lang.Object
-
- org.apache.openjpa.jdbc.kernel.AbstractUpdateManager
-
- All Implemented Interfaces:
UpdateManager,Configurable
- Direct Known Subclasses:
ConstraintUpdateManager,OperationOrderUpdateManager
public abstract class AbstractUpdateManager extends java.lang.Object implements UpdateManager, Configurable
Base update manager with common functionality.- Author:
- Abe White
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classAbstractUpdateManager.CustomMappingExecutes customized mapping updates.
-
Field Summary
Fields Modifier and Type Field Description protected JDBCConfigurationconfprotected DBDictionarydict
-
Constructor Summary
Constructors Constructor Description AbstractUpdateManager()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.CollectionaddException(java.util.Collection exceps, java.lang.Exception err)Add the given exception to the given list, which may start out as null.protected voiddelete(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, java.util.Collection customs)Recursive method to delete the given instance, base class last.voidendConfiguration()Invoked upon completion of bean property configuration for this object.java.util.Collectionflush(java.util.Collection states, JDBCStore store)Flush the given instances to the data store.protected java.util.Collectionflush(java.util.Collection states, JDBCStore store, PreparedStatementManager psMgr)protected abstract java.util.Collectionflush(RowManager rowMgr, PreparedStatementManager psMgr, java.util.Collection exceps)Flush all rows of the given row manager.protected voidinsert(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, java.util.Collection customs)Recursive method to insert the given instance, base class first.protected abstract PreparedStatementManagernewPreparedStatementManager(JDBCStore store, java.sql.Connection conn)Return a newPreparedStatementManager.protected abstract RowManagernewRowManager()Return a newRowManager.protected java.util.CollectionpopulateRowManager(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.voidsetConfiguration(Configuration conf)Invoked prior to setting bean properties.voidstartConfiguration()Invoked before bean property configuration is begun on this object.protected voidupdate(OpenJPAStateManager sm, java.util.BitSet dirty, ClassMapping mapping, RowManager rowMgr, JDBCStore store, java.util.Collection customs, boolean updateIndicators)Recursive method to update the given instance.protected voidupdateIndicators(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, java.util.Collection customs, boolean versionUpdateOnly)Update version and discriminator indicators.-
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
-
-
Method Detail
-
setConfiguration
public void setConfiguration(Configuration conf)
Description copied from interface:ConfigurableInvoked prior to setting bean properties.- Specified by:
setConfigurationin interfaceConfigurable
-
startConfiguration
public void startConfiguration()
Description copied from interface:ConfigurableInvoked before bean property configuration is begun on this object.- Specified by:
startConfigurationin interfaceConfigurable
-
endConfiguration
public void endConfiguration()
Description copied from interface:ConfigurableInvoked upon completion of bean property configuration for this object.- Specified by:
endConfigurationin interfaceConfigurable
-
flush
public java.util.Collection flush(java.util.Collection states, JDBCStore store)Description copied from interface:UpdateManagerFlush the given instances to the data store.- Specified by:
flushin interfaceUpdateManager- See Also:
StoreManager.flush(java.util.Collection<org.apache.openjpa.kernel.OpenJPAStateManager>)
-
flush
protected java.util.Collection flush(java.util.Collection states, JDBCStore store, PreparedStatementManager psMgr)
-
newRowManager
protected abstract RowManager newRowManager()
Return a newRowManager.
-
newPreparedStatementManager
protected abstract PreparedStatementManager newPreparedStatementManager(JDBCStore store, java.sql.Connection conn)
Return a newPreparedStatementManager.
-
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 toexceps(which may start as null) usingaddException(java.util.Collection, java.lang.Exception). Returnexceps.
-
populateRowManager
protected java.util.Collection populateRowManager(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 initiallycustoms- 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.
-
insert
protected void insert(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, java.util.Collection customs) throws java.sql.SQLException
Recursive method to insert the given instance, base class first.- Throws:
java.sql.SQLException
-
delete
protected void delete(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, java.util.Collection customs) throws java.sql.SQLException
Recursive method to delete the given instance, base class last.- Throws:
java.sql.SQLException
-
update
protected void update(OpenJPAStateManager sm, java.util.BitSet dirty, ClassMapping mapping, RowManager rowMgr, JDBCStore store, java.util.Collection customs, boolean updateIndicators) throws java.sql.SQLException
Recursive method to update the given instance.- Throws:
java.sql.SQLException
-
updateIndicators
protected void updateIndicators(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, java.util.Collection customs, boolean versionUpdateOnly) throws java.sql.SQLException
Update version and discriminator indicators.- Throws:
java.sql.SQLException
-
-