Package org.apache.openjpa.jdbc.sql
Class RowManagerImpl
java.lang.Object
org.apache.openjpa.jdbc.sql.RowManagerImpl
- All Implemented Interfaces:
RowManager
Manages SQL rows during an insert/update/delete process.
- Author:
- Abe White
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
flushAllRows
(Row row) Flush the logical row.void
flushSecondaryRow
(Row row) Flush the secondary row; after flushing the row is available for reuse.Return any 'all row' deletes.getAllRows
(Table table, int action) Return a logical row representing an update that should be made to all rows of the given table.Return any 'all row' updates.Return all deleted primary rows.Return all inserted primary rows.Return the ordered primary rows.getRow
(Table table, int action, OpenJPAStateManager sm, boolean create) Return the row for the given table and owner object, or null ifcreate
is false and the row has not already been created.Return all deleted secondary rows.getSecondaryRow
(Table table, int action) Return a row for the given secondary table.Return all inserted and updated secondary rows.Return all updated primary rows.boolean
Whether any primary rows have auto-assign constraints.
-
Constructor Details
-
RowManagerImpl
public RowManagerImpl(boolean order) Constructor.- Parameters:
order
- whether to keep track of the order in which rows are added
-
-
Method Details
-
hasAutoAssignConstraints
public boolean hasAutoAssignConstraints()Whether any primary rows have auto-assign constraints. -
getOrdered
Return the ordered primary rows. Only available if ordering requested on construction. -
getInserts
Return all inserted primary rows. -
getUpdates
Return all updated primary rows. -
getDeletes
Return all deleted primary rows. -
getSecondaryUpdates
Return all inserted and updated secondary rows. -
getSecondaryDeletes
Return all deleted secondary rows. -
getAllRowUpdates
Return any 'all row' updates. -
getAllRowDeletes
Return any 'all row' deletes. -
getSecondaryRow
Description copied from interface:RowManager
Return a row for the given secondary table. The action must be one ofRow.ACTION_INSERT
,Row.ACTION_UPDATE
,Row.ACTION_DELETE
. Note that secondary rows are not considered when creating the foreign key dependency graph, with can cause constraint violations when using theUPDATE
action. Only use this action if the secondary row does not have restrict-action foreign keys. Otherwise use both a delete and then an insert to perform the update.- Specified by:
getSecondaryRow
in interfaceRowManager
-
flushSecondaryRow
Description copied from interface:RowManager
Flush the secondary row; after flushing the row is available for reuse. It will retain all previously set values.- Specified by:
flushSecondaryRow
in interfaceRowManager
- Throws:
SQLException
-
getAllRows
Description copied from interface:RowManager
Return a logical row representing an update that should be made to all rows of the given table. The action must be one ofRow.ACTION_UPDATE
,Row.ACTION_DELETE
.- Specified by:
getAllRows
in interfaceRowManager
-
flushAllRows
Description copied from interface:RowManager
Flush the logical row.- Specified by:
flushAllRows
in interfaceRowManager
-
getRow
Description copied from interface:RowManager
Return the row for the given table and owner object, or null ifcreate
is false and the row has not already been created. The action must be one ofRow.ACTION_INSERT
,Row.ACTION_UPDATE
,Row.ACTION_DELETE
.- Specified by:
getRow
in interfaceRowManager
-