Package org.apache.openjpa.jdbc.sql
Interface Row
-
- All Known Implementing Classes:
PrimaryRow,RowImpl,SecondaryRow,StateComparisonVersionStrategy.CustomUpdate
public interface RowLogical representation of a table row for insert/update/delete. TheUpdateManageris responsible for implementing rows to do something useful when the values are set.- Author:
- Abe White
-
-
Field Summary
Fields Modifier and Type Field Description static intACTION_DELETEMark the row for deletion.static intACTION_INSERTMark the row for inserttion.static intACTION_UNKNOWNSymbolic constant reserved for situations when a row operation is unknown.static intACTION_UPDATEMark the row for update.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description intgetAction()Return the action for this row.ObjectgetFailedObject()Return the failed object to include in optimistic lock exceptions.OpenJPAStateManagergetPrimaryKey()Return the instance that controls this row.TablegetTable()Return the table for this row.booleanisValid()Whether this row has information set on it.voidsetArray(Column col, Array val)Set the value of the given column in this row.voidsetAsciiStream(Column col, InputStream val, int length)Set the value of the given column in this row.voidsetBigDecimal(Column col, BigDecimal val)Set the value of the given column in this row.voidsetBigInteger(Column col, BigInteger val)Set the value of the given column in this row.voidsetBinaryStream(Column col, InputStream val, int length)Set the value of the given column in this row.voidsetBlob(Column col, Blob val)Set the value of the given column in this row.voidsetBoolean(Column col, boolean val)Set the value of the given column in this row.voidsetByte(Column col, byte val)Set the value of the given column in this row.voidsetBytes(Column col, byte[] val)Set the value of the given column in this row.voidsetCalendar(Column col, Calendar val)Set the value of the given column in this row.voidsetChar(Column col, char val)Set the value of the given column in this row.voidsetCharacterStream(Column col, Reader val, int length)Set the value of the given column in this row.voidsetClob(Column col, Clob val)Set the value of the given column in this row.voidsetDate(Column col, Date val, Calendar cal)Set the value of the given column in this row.voidsetDate(Column col, Date val)Set the value of the given column in this row.voidsetDouble(Column col, double val)Set the value of the given column in this row.voidsetFailedObject(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.voidsetFloat(Column col, float val)Set the value of the given column in this row.voidsetForeignKey(ForeignKey fk, ColumnIO io, OpenJPAStateManager sm)Set the value of the given foreign key to the given object.voidsetForeignKey(ForeignKey fk, OpenJPAStateManager sm)Set the value of the given foreign key to the given object.voidsetInt(Column col, int val)Set the value of the given column in this row.voidsetLocale(Column col, Locale val)Set the value of the given column in this row.voidsetLong(Column col, long val)Set the value of the given column in this row.voidsetNull(Column col)Set the value of the given column in this row.voidsetNull(Column col, boolean overrideDefault)Set the value of the given column in this row.voidsetNumber(Column col, Number val)Set the value of the given column in this row.voidsetObject(Column col, Object val)Set the value of the given column in this row.voidsetPrimaryKey(ColumnIO io, OpenJPAStateManager sm)Set the primary key to represent the given object.voidsetPrimaryKey(OpenJPAStateManager sm)Set the primary key to represent the given object.voidsetRaw(Column col, String value)Set a DB understood value for the given column.voidsetRelationId(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.voidsetShort(Column col, short val)Set the value of the given column in this row.voidsetString(Column col, String val)Set the value of the given column in this row.voidsetTime(Column col, Time val, Calendar cal)Set the value of the given column in this row.voidsetTimestamp(Column col, Timestamp val, Calendar cal)Set the value of the given column in this row.voidsetValid(boolean valid)Whether this row has information set on it.voidwhereArray(Column col, Array val)Set an equality condition on the value of the given column in this row.voidwhereAsciiStream(Column col, InputStream val, int length)Set an equality condition on the value of the given column in this row.voidwhereBigDecimal(Column col, BigDecimal val)Set an equality condition on the value of the given column in this row.voidwhereBigInteger(Column col, BigInteger val)Set an equality condition on the value of the given column in this row.voidwhereBinaryStream(Column col, InputStream val, int length)Set an equality condition on the value of the given column in this row.voidwhereBlob(Column col, Blob val)Set an equality condition on the value of the given column in this row.voidwhereBoolean(Column col, boolean val)Set an equality condition on the value of the given column in this row.voidwhereByte(Column col, byte val)Set an equality condition on the value of the given column in this row.voidwhereBytes(Column col, byte[] val)Set an equality condition on the value of the given column in this row.voidwhereCalendar(Column col, Calendar val)Set an equality condition on the value of the given column in this row.voidwhereChar(Column col, char val)Set an equality condition on the value of the given column in this row.voidwhereCharacterStream(Column col, Reader val, int length)Set an equality condition on the value of the given column in this row.voidwhereClob(Column col, Clob val)Set an equality condition on the value of the given column in this row.voidwhereDate(Column col, Date val, Calendar cal)Set an equality condition on the value of the given column in this row.voidwhereDate(Column col, Date val)Set an equality condition on the value of the given column in this row.voidwhereDouble(Column col, double val)Set an equality condition on the value of the given column in this row.voidwhereFloat(Column col, float val)Set an equality condition on the value of the given column in this row.voidwhereForeignKey(ForeignKey fk, OpenJPAStateManager sm)Set the foreign key equality criteria to link to the given object.voidwhereInt(Column col, int val)Set an equality condition on the value of the given column in this row.voidwhereLocale(Column col, Locale val)Set an equality condition on the value of the given column in this row.voidwhereLong(Column col, long val)Set an equality condition on the value of the given column in this row.voidwhereNull(Column col)Set an equality condition on the value of the given column in this row.voidwhereNumber(Column col, Number val)Set an equality condition on the value of the given column in this row.voidwhereObject(Column col, Object val)Set an equality condition on the value of the given column in this row.voidwherePrimaryKey(OpenJPAStateManager sm)Set the primary key equality criteria for this row.voidwhereRaw(Column col, String value)Set a DB understood where condition for the given column.voidwhereShort(Column col, short val)Set an equality condition on the value of the given column in this row.voidwhereString(Column col, String val)Set an equality condition on the value of the given column in this row.voidwhereTime(Column col, Time val, Calendar cal)Set an equality condition on the value of the given column in this row.voidwhereTimestamp(Column col, Timestamp val, Calendar cal)Set an equality condition on the value of the given column in this row.
-
-
-
Field Detail
-
ACTION_UNKNOWN
static final int ACTION_UNKNOWN
Symbolic constant reserved for situations when a row operation is unknown.- See Also:
- Constant Field Values
-
ACTION_UPDATE
static final int ACTION_UPDATE
Mark the row for update.- See Also:
- Constant Field Values
-
ACTION_INSERT
static final int ACTION_INSERT
Mark the row for inserttion.- See Also:
- Constant Field Values
-
ACTION_DELETE
static final int ACTION_DELETE
Mark the row for deletion.- See Also:
- Constant Field Values
-
-
Method Detail
-
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
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. 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
void setPrimaryKey(OpenJPAStateManager sm) throws SQLException
Set the primary key to represent the given object.- Throws:
SQLException
-
setPrimaryKey
void setPrimaryKey(ColumnIO io, OpenJPAStateManager sm) throws SQLException
Set the primary key to represent the given object.- Parameters:
io- information on which columns are settable; may be null- Throws:
SQLException
-
wherePrimaryKey
void wherePrimaryKey(OpenJPAStateManager sm) throws SQLException
Set the primary key equality criteria for this row.- Throws:
SQLException
-
setForeignKey
void setForeignKey(ForeignKey fk, OpenJPAStateManager sm) throws SQLException
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
void setForeignKey(ForeignKey fk, ColumnIO io, OpenJPAStateManager sm) throws SQLException
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
void whereForeignKey(ForeignKey fk, OpenJPAStateManager sm) throws SQLException
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
void setArray(Column col, Array val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setAsciiStream
void setAsciiStream(Column col, InputStream val, int length) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setBigDecimal
void setBigDecimal(Column col, BigDecimal val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setBigInteger
void setBigInteger(Column col, BigInteger val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setBinaryStream
void setBinaryStream(Column col, InputStream val, int length) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setBlob
void setBlob(Column col, Blob val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setBoolean
void setBoolean(Column col, boolean val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setByte
void setByte(Column col, byte val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setBytes
void setBytes(Column col, byte[] val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setCalendar
void setCalendar(Column col, Calendar val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setChar
void setChar(Column col, char val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setCharacterStream
void setCharacterStream(Column col, Reader val, int length) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setClob
void setClob(Column col, Clob val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setDate
void setDate(Column col, Date val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setDate
void setDate(Column col, Date val, Calendar cal) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setDouble
void setDouble(Column col, double val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setFloat
void setFloat(Column col, float val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setInt
void setInt(Column col, int val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setLong
void setLong(Column col, long val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setLocale
void setLocale(Column col, Locale val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setNull
void setNull(Column col) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setNull
void setNull(Column col, boolean overrideDefault) throws SQLException
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
void setNumber(Column col, Number val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setObject
void setObject(Column col, Object val) throws SQLException
Set the value of the given column in this row.- Parameters:
col- the column being setval- the value for the column- Throws:
SQLException
-
setRaw
void setRaw(Column col, String value) throws SQLException
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
void setRelationId(Column col, OpenJPAStateManager sm, RelationId rel) throws SQLException
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
void setShort(Column col, short val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setString
void setString(Column col, String val) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setTime
void setTime(Column col, Time val, Calendar cal) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
setTimestamp
void setTimestamp(Column col, Timestamp val, Calendar cal) throws SQLException
Set the value of the given column in this row.- Throws:
SQLException
-
whereArray
void whereArray(Column col, Array val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereAsciiStream
void whereAsciiStream(Column col, InputStream val, int length) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBigDecimal
void whereBigDecimal(Column col, BigDecimal val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBigInteger
void whereBigInteger(Column col, BigInteger val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBinaryStream
void whereBinaryStream(Column col, InputStream val, int length) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBlob
void whereBlob(Column col, Blob val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBoolean
void whereBoolean(Column col, boolean val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereByte
void whereByte(Column col, byte val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereBytes
void whereBytes(Column col, byte[] val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereCalendar
void whereCalendar(Column col, Calendar val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereChar
void whereChar(Column col, char val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereCharacterStream
void whereCharacterStream(Column col, Reader val, int length) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereClob
void whereClob(Column col, Clob val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereDate
void whereDate(Column col, Date val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereDate
void whereDate(Column col, Date val, Calendar cal) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereDouble
void whereDouble(Column col, double val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereFloat
void whereFloat(Column col, float val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereInt
void whereInt(Column col, int val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereLong
void whereLong(Column col, long val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereLocale
void whereLocale(Column col, Locale val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereNull
void whereNull(Column col) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereNumber
void whereNumber(Column col, Number val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereObject
void whereObject(Column col, Object val) throws SQLException
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
void whereRaw(Column col, String value) throws SQLException
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
void whereShort(Column col, short val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereString
void whereString(Column col, String val) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereTime
void whereTime(Column col, Time val, Calendar cal) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
whereTimestamp
void whereTimestamp(Column col, Timestamp val, Calendar cal) throws SQLException
Set an equality condition on the value of the given column in this row.- Throws:
SQLException
-
-