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
Base update manager with common functionality.
- Author:
- Abe White
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Executes customized mapping updates. -
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Collection
addException
(Collection exceps, Exception err) Add the given exception to the given list, which may start out as null.protected void
delete
(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs) Recursive method to delete the given instance, base class last.void
Invoked upon completion of bean property configuration for this object.flush
(Collection states, JDBCStore store) Flush the given instances to the data store.protected Collection
flush
(Collection states, JDBCStore store, PreparedStatementManager psMgr) protected abstract Collection
flush
(RowManager rowMgr, PreparedStatementManager psMgr, Collection exceps) Flush all rows of the given row manager.protected void
insert
(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs) Recursive method to insert the given instance, base class first.protected abstract PreparedStatementManager
newPreparedStatementManager
(JDBCStore store, Connection conn) Return a newPreparedStatementManager
.protected abstract RowManager
Return a newRowManager
.protected Collection
populateRowManager
(OpenJPAStateManager sm, RowManager rowMgr, JDBCStore store, Collection exceps, Collection customs) Populate the row manager with rows to be flushed for the given state.void
Invoked prior to setting bean properties.void
Invoked before bean property configuration is begun on this object.protected void
update
(OpenJPAStateManager sm, BitSet dirty, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs, boolean updateIndicators) Recursive method to update the given instance.protected void
updateIndicators
(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, 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 Details
-
conf
-
dict
-
-
Constructor Details
-
AbstractUpdateManager
public AbstractUpdateManager()
-
-
Method Details
-
setConfiguration
Description copied from interface:Configurable
Invoked prior to setting bean properties.- Specified by:
setConfiguration
in interfaceConfigurable
-
startConfiguration
public void startConfiguration()Description copied from interface:Configurable
Invoked before bean property configuration is begun on this object.- Specified by:
startConfiguration
in interfaceConfigurable
-
endConfiguration
public void endConfiguration()Description copied from interface:Configurable
Invoked upon completion of bean property configuration for this object.- Specified by:
endConfiguration
in interfaceConfigurable
-
flush
Description copied from interface:UpdateManager
Flush the given instances to the data store.- Specified by:
flush
in interfaceUpdateManager
- See Also:
-
flush
-
newRowManager
Return a newRowManager
. -
newPreparedStatementManager
protected abstract PreparedStatementManager newPreparedStatementManager(JDBCStore store, Connection conn) Return a newPreparedStatementManager
. -
flush
protected abstract Collection flush(RowManager rowMgr, PreparedStatementManager psMgr, 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 Collection populateRowManager(OpenJPAStateManager sm, RowManager rowMgr, JDBCStore store, Collection exceps, 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
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, Collection customs) throws SQLException Recursive method to insert the given instance, base class first.- Throws:
SQLException
-
delete
protected void delete(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs) throws SQLException Recursive method to delete the given instance, base class last.- Throws:
SQLException
-
update
protected void update(OpenJPAStateManager sm, BitSet dirty, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs, boolean updateIndicators) throws SQLException Recursive method to update the given instance.- Throws:
SQLException
-
updateIndicators
protected void updateIndicators(OpenJPAStateManager sm, ClassMapping mapping, RowManager rowMgr, JDBCStore store, Collection customs, boolean versionUpdateOnly) throws SQLException Update version and discriminator indicators.- Throws:
SQLException
-