Package org.apache.openjpa.jdbc.sql
Class RowManagerImpl
- java.lang.Object
-
- org.apache.openjpa.jdbc.sql.RowManagerImpl
-
- All Implemented Interfaces:
RowManager
public class RowManagerImpl extends Object implements RowManager
Manages SQL rows during an insert/update/delete process.- Author:
- Abe White
-
-
Constructor Summary
Constructors Constructor Description RowManagerImpl(boolean order)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidflushAllRows(Row row)Flush the logical row.voidflushSecondaryRow(Row row)Flush the secondary row; after flushing the row is available for reuse.Collection<Row>getAllRowDeletes()Return any 'all row' deletes.RowgetAllRows(Table table, int action)Return a logical row representing an update that should be made to all rows of the given table.Collection<Row>getAllRowUpdates()Return any 'all row' updates.Collection<PrimaryRow>getDeletes()Return all deleted primary rows.Collection<PrimaryRow>getInserts()Return all inserted primary rows.List<PrimaryRow>getOrdered()Return the ordered primary rows.RowgetRow(Table table, int action, OpenJPAStateManager sm, boolean create)Return the row for the given table and owner object, or null ifcreateis false and the row has not already been created.Collection<SecondaryRow>getSecondaryDeletes()Return all deleted secondary rows.RowgetSecondaryRow(Table table, int action)Return a row for the given secondary table.Collection<SecondaryRow>getSecondaryUpdates()Return all inserted and updated secondary rows.Collection<PrimaryRow>getUpdates()Return all updated primary rows.booleanhasAutoAssignConstraints()Whether any primary rows have auto-assign constraints.
-
-
-
Method Detail
-
hasAutoAssignConstraints
public boolean hasAutoAssignConstraints()
Whether any primary rows have auto-assign constraints.
-
getOrdered
public List<PrimaryRow> getOrdered()
Return the ordered primary rows. Only available if ordering requested on construction.
-
getInserts
public Collection<PrimaryRow> getInserts()
Return all inserted primary rows.
-
getUpdates
public Collection<PrimaryRow> getUpdates()
Return all updated primary rows.
-
getDeletes
public Collection<PrimaryRow> getDeletes()
Return all deleted primary rows.
-
getSecondaryUpdates
public Collection<SecondaryRow> getSecondaryUpdates()
Return all inserted and updated secondary rows.
-
getSecondaryDeletes
public Collection<SecondaryRow> getSecondaryDeletes()
Return all deleted secondary rows.
-
getAllRowUpdates
public Collection<Row> getAllRowUpdates()
Return any 'all row' updates.
-
getAllRowDeletes
public Collection<Row> getAllRowDeletes()
Return any 'all row' deletes.
-
getSecondaryRow
public Row getSecondaryRow(Table table, int action)
Description copied from interface:RowManagerReturn 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 theUPDATEaction. 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:
getSecondaryRowin interfaceRowManager
-
flushSecondaryRow
public void flushSecondaryRow(Row row) throws SQLException
Description copied from interface:RowManagerFlush the secondary row; after flushing the row is available for reuse. It will retain all previously set values.- Specified by:
flushSecondaryRowin interfaceRowManager- Throws:
SQLException
-
getAllRows
public Row getAllRows(Table table, int action)
Description copied from interface:RowManagerReturn 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:
getAllRowsin interfaceRowManager
-
flushAllRows
public void flushAllRows(Row row)
Description copied from interface:RowManagerFlush the logical row.- Specified by:
flushAllRowsin interfaceRowManager
-
getRow
public Row getRow(Table table, int action, OpenJPAStateManager sm, boolean create)
Description copied from interface:RowManagerReturn the row for the given table and owner object, or null ifcreateis 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:
getRowin interfaceRowManager
-
-