Class StateComparisonVersionStrategy.CustomUpdate
- java.lang.Object
-
- org.apache.openjpa.jdbc.sql.RowImpl
-
- org.apache.openjpa.jdbc.meta.strats.StateComparisonVersionStrategy.CustomUpdate
-
- All Implemented Interfaces:
java.lang.Cloneable,Row,RowManager
- Enclosing class:
- StateComparisonVersionStrategy
public static class StateComparisonVersionStrategy.CustomUpdate extends RowImpl implements RowManager
Row implementation we use to pass to versionable mappings so they can set up the where conditions we need to add to update statements.- Author:
- Abe White
-
-
Field Summary
-
Fields inherited from interface org.apache.openjpa.jdbc.sql.Row
ACTION_DELETE, ACTION_INSERT, ACTION_UNKNOWN, ACTION_UPDATE
-
-
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.java.util.CollectiongetAllRowDeletes()RowgetAllRows(Table table, int action)Return a logical row representing an update that should be made to all rows of the given table.java.util.CollectiongetAllRowUpdates()java.util.CollectiongetDeletes()java.util.CollectiongetInserts()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.java.util.CollectiongetSecondaryDeletes()RowgetSecondaryRow(Table table, int action)Return a row for the given secondary table.java.util.CollectiongetSecondaryUpdates()java.lang.StringgetSQL(DBDictionary dict)Return a boolean SQL expression that should be added to the WHERE clause of an UPDATE to test whether the current database record matches our stored version.java.util.CollectiongetUpdates()booleanhasAutoAssignConstraints()protected RowImplnewInstance(Column[] cols, int action)Return a new row.voidsetObject(Column col, java.lang.Object val)Set the value of the given column in this row.-
Methods inherited from class org.apache.openjpa.jdbc.sql.RowImpl
canSet, canSetAny, clearForeignKey, clearRelationId, clone, copyInto, flush, flush, generateSQL, getAction, getColumns, getFailedObject, getParameterCount, getPrimaryKey, getSet, getTable, getTypes, getVals, getWhere, isDependent, isFlushed, isValid, setArray, setAsciiStream, setBigDecimal, setBigInteger, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCalendar, setChar, setCharacterStream, setClob, setDate, setDate, setDouble, setFailedObject, setFloat, setFlushed, setForeignKey, setForeignKey, setInt, setLocale, setLong, setNull, setNull, setNumber, setObject, setPrimaryKey, setPrimaryKey, setRaw, setRelationId, setShort, setString, setTime, setTimestamp, setValid, whereArray, whereAsciiStream, whereBigDecimal, whereBigInteger, whereBinaryStream, whereBlob, whereBoolean, whereByte, whereBytes, whereCalendar, whereChar, whereCharacterStream, whereClob, whereDate, whereDate, whereDouble, whereFloat, whereForeignKey, whereInt, whereLocale, whereLong, whereNull, whereNumber, whereObject, whereObject, wherePrimaryKey, whereRaw, whereShort, whereString, whereTime, whereTimestamp
-
-
-
-
Method Detail
-
getSQL
public java.lang.String getSQL(DBDictionary dict)
Return a boolean SQL expression that should be added to the WHERE clause of an UPDATE to test whether the current database record matches our stored version.
-
newInstance
protected RowImpl newInstance(Column[] cols, int action)
Description copied from class:RowImplReturn a new row.- Overrides:
newInstancein classRowImpl
-
hasAutoAssignConstraints
public boolean hasAutoAssignConstraints()
-
getInserts
public java.util.Collection getInserts()
-
getUpdates
public java.util.Collection getUpdates()
-
getDeletes
public java.util.Collection getDeletes()
-
getSecondaryUpdates
public java.util.Collection getSecondaryUpdates()
-
getSecondaryDeletes
public java.util.Collection getSecondaryDeletes()
-
getAllRowUpdates
public java.util.Collection getAllRowUpdates()
-
getAllRowDeletes
public java.util.Collection getAllRowDeletes()
-
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
-
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)
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
-
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
-
-