Package org.apache.openjpa.jdbc.sql
Interface Row
- All Known Implementing Classes:
PrimaryRow
,RowImpl
,SecondaryRow
,StateComparisonVersionStrategy.CustomUpdate
public interface Row
Logical representation of a table row for insert/update/delete. The
UpdateManager
is responsible for
implementing rows to do something useful when the values are set.- Author:
- Abe White
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Mark the row for deletion.static final int
Mark the row for inserttion.static final int
Symbolic constant reserved for situations when a row operation is unknown.static final int
Mark the row for update. -
Method Summary
Modifier and TypeMethodDescriptionint
Return the action for this row.Return the failed object to include in optimistic lock exceptions.Return the instance that controls this row.getTable()
Return the table for this row.boolean
isValid()
Whether this row has information set on it.void
Set the value of the given column in this row.void
setAsciiStream
(Column col, InputStream val, int length) Set the value of the given column in this row.void
setBigDecimal
(Column col, BigDecimal val) Set the value of the given column in this row.void
setBigInteger
(Column col, BigInteger val) Set the value of the given column in this row.void
setBinaryStream
(Column col, InputStream val, int length) Set the value of the given column in this row.void
Set the value of the given column in this row.void
setBoolean
(Column col, boolean val) Set the value of the given column in this row.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
setCalendar
(Column col, Calendar val) Set the value of the given column in this row.void
Set the value of the given column in this row.void
setCharacterStream
(Column col, Reader val, int length) Set the value of the given column in this row.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
setFailedObject
(Object failed) Set the failed object to include in the optimistic lock exception that will be thrown if this update results in an update count of 0 when executed.void
Set the value of the given column in this row.void
setForeignKey
(ForeignKey fk, ColumnIO io, OpenJPAStateManager sm) Set the value of the given foreign key to the given object.void
Set the value of the given foreign key to the given object.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
setPrimaryKey
(ColumnIO io, OpenJPAStateManager sm) Set the primary key to represent the given object.void
Set the primary key to represent the given object.void
Set a DB understood value for the given column.void
setRelationId
(Column col, OpenJPAStateManager sm, RelationId rel) Set the value of the given column to the identity of given instance, using the given callback to create the column value.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
Set the value of the given column in this row.void
setTimestamp
(Column col, Timestamp val, Calendar cal) Set the value of the given column in this row.void
setValid
(boolean valid) Whether this row has information set on it.void
whereArray
(Column col, Array val) Set an equality condition on the value of the given column in this row.void
whereAsciiStream
(Column col, InputStream val, int length) Set an equality condition on the value of the given column in this row.void
whereBigDecimal
(Column col, BigDecimal val) Set an equality condition on the value of the given column in this row.void
whereBigInteger
(Column col, BigInteger val) Set an equality condition on the value of the given column in this row.void
whereBinaryStream
(Column col, InputStream val, int length) Set an equality condition on the value of the given column in this row.void
Set an equality condition on the value of the given column in this row.void
whereBoolean
(Column col, boolean val) Set an equality condition on the value of the given column in this row.void
Set an equality condition on the value of the given column in this row.void
whereBytes
(Column col, byte[] val) Set an equality condition on the value of the given column in this row.void
whereCalendar
(Column col, Calendar val) Set an equality condition on the value of the given column in this row.void
Set an equality condition on the value of the given column in this row.void
whereCharacterStream
(Column col, Reader val, int length) Set an equality condition on the value of the given column in this row.void
Set an equality condition on the value of the given column in this row.void
Set an equality condition on the value of the given column in this row.void
Set an equality condition on the value of the given column in this row.void
whereDouble
(Column col, double val) Set an equality condition on the value of the given column in this row.void
whereFloat
(Column col, float val) Set an equality condition on the value of the given column in this row.void
Set the foreign key equality criteria to link to the given object.void
Set an equality condition on the value of the given column in this row.void
whereLocale
(Column col, Locale val) Set an equality condition on the value of the given column in this row.void
Set an equality condition on the value of the given column in this row.void
Set an equality condition on the value of the given column in this row.void
whereNumber
(Column col, Number val) Set an equality condition on the value of the given column in this row.void
whereObject
(Column col, Object val) Set an equality condition on the value of the given column in this row.void
Set the primary key equality criteria for this row.void
Set a DB understood where condition for the given column.void
whereShort
(Column col, short val) Set an equality condition on the value of the given column in this row.void
whereString
(Column col, String val) Set an equality condition on the value of the given column in this row.void
Set an equality condition on the value of the given column in this row.void
whereTimestamp
(Column col, Timestamp val, Calendar cal) Set an equality condition on the value of the given column in this row.
-
Field Details
-
ACTION_UNKNOWN
static final int ACTION_UNKNOWNSymbolic constant reserved for situations when a row operation is unknown.- See Also:
-
ACTION_UPDATE
static final int ACTION_UPDATEMark the row for update.- See Also:
-
ACTION_INSERT
static final int ACTION_INSERTMark the row for inserttion.- See Also:
-
ACTION_DELETE
static final int ACTION_DELETEMark the row for deletion.- See Also:
-
-
Method Details
-
getTable
Table getTable()Return the table for this row. -
getAction
int getAction()Return the action for this row. -
getFailedObject
Object getFailedObject()Return the failed object to include in optimistic lock exceptions. -
setFailedObject
Set the failed object to include in the optimistic lock exception that will be thrown if this update results in an update count of 0 when executed. Leave null to avoid checking the update count. -
isValid
boolean isValid()Whether this row has information set on it. -
setValid
void setValid(boolean valid) Whether this row has information set on it. -
getPrimaryKey
OpenJPAStateManager getPrimaryKey()Return the instance that controls this row. ThesetPrimaryKey(org.apache.openjpa.kernel.OpenJPAStateManager)
method does not necessarily have to be called to know the owning instance, nor does this row's table have to have an actual primary key. -
setPrimaryKey
Set the primary key to represent the given object.- Throws:
SQLException
-
setPrimaryKey
Set the primary key to represent the given object.- Parameters:
io
- information on which columns are settable; may be null- Throws:
SQLException
-
wherePrimaryKey
Set the primary key equality criteria for this row.- Throws:
SQLException
-
setForeignKey
Set the value of the given foreign key to the given object. If the related type uses table-per-class mappings, the foreign key may be targeted at an independent superclass table.- Throws:
SQLException
-
setForeignKey
Set the value of the given foreign key to the given object. If the related type uses table-per-class mappings, the foreign key may be targeted at an independent superclass table.- Parameters:
io
- information on which columns are settable; may be null- Throws:
SQLException
-
whereForeignKey
Set the foreign key equality criteria to link to the given object. If the related type uses table-per-class mappings, the foreign key may be targeted at an independent superclass table.- Throws:
SQLException
-
setArray
Set the value of the given column in this row.- Throws:
SQLException
-
setAsciiStream
Set the value of the given column in this row.- Throws:
SQLException
-
setBigDecimal
Set the value of the given column in this row.- Throws:
SQLException
-
setBigInteger
Set the value of the given column in this row.- Throws:
SQLException
-
setBinaryStream
Set the value of the given column in this row.- Throws:
SQLException
-
setBlob
Set the value of the given column in this row.- Throws:
SQLException
-
setBoolean
Set the value of the given column in this row.- Throws:
SQLException
-
setByte
Set the value of the given column in this row.- Throws:
SQLException
-
setBytes
Set the value of the given column in this row.- Throws:
SQLException
-
setCalendar
Set the value of the given column in this row.- Throws:
SQLException
-
setChar
Set the value of the given column in this row.- Throws:
SQLException
-
setCharacterStream
Set the value of the given column in this row.- Throws:
SQLException
-
setClob
Set the value of the given column in this row.- Throws:
SQLException
-
setDate
Set the value of the given column in this row.- Throws:
SQLException
-
setDate
Set the value of the given column in this row.- Throws:
SQLException
-
setDouble
Set the value of the given column in this row.- Throws:
SQLException
-
setFloat
Set the value of the given column in this row.- Throws:
SQLException
-
setInt
Set the value of the given column in this row.- Throws:
SQLException
-
setLong
Set the value of the given column in this row.- Throws:
SQLException
-
setLocale
Set the value of the given column in this row.- Throws:
SQLException
-
setNull
Set the value of the given column in this row.- Throws:
SQLException
-
setNull
Set the value of the given column in this row.- Parameters:
overrideDefault
- whether to set this column to null even if this is an insert and the column has a default- Throws:
SQLException
-
setNumber
Set the value of the given column in this row.- Throws:
SQLException
-
setObject
Set the value of the given column in this row.- Parameters:
col
- the column being setval
- the value for the column- Throws:
SQLException
-
setRaw
Set a DB understood value for the given column. The value will not be parameterized and instead be inserted as raw SQL.- Throws:
SQLException
-
setRelationId
Set the value of the given column to the identity of given instance, using the given callback to create the column value. This method is used for mappings that store some serialized form of id values, but must make sure that the related object's id is assigned (which might require an insert if the instance uses auto-increment) before it is serialized.- Throws:
SQLException
-
setShort
Set the value of the given column in this row.- Throws:
SQLException
-
setString
Set the value of the given column in this row.- Throws:
SQLException
-
setTime
Set the value of the given column in this row.- Throws:
SQLException
-
setTimestamp
Set the value of the given column in this row.- Throws:
SQLException
-
whereArray
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereAsciiStream
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBigDecimal
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBigInteger
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBinaryStream
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBlob
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBoolean
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereByte
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBytes
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereCalendar
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereChar
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereCharacterStream
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereClob
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereDate
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereDate
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereDouble
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereFloat
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereInt
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereLong
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereLocale
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereNull
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereNumber
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereObject
Set an equality condition on the value of the given column in this row.- Parameters:
col
- the column being setval
- the value for the column- Throws:
SQLException
-
whereRaw
Set a DB understood where condition for the given column. The value will not be parameterized and instead be inserted as raw SQL.- Throws:
SQLException
-
whereShort
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereString
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereTime
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereTimestamp
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-