Package org.apache.openjpa.jdbc.sql
Class PrimaryRow
- java.lang.Object
-
- org.apache.openjpa.jdbc.sql.RowImpl
-
- org.apache.openjpa.jdbc.sql.PrimaryRow
-
-
Field Summary
-
Fields inherited from interface org.apache.openjpa.jdbc.sql.Row
ACTION_DELETE, ACTION_INSERT, ACTION_UNKNOWN, ACTION_UPDATE
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
PrimaryRow(Column[] cols, int action, OpenJPAStateManager owner)
PrimaryRow(Table table, int action, OpenJPAStateManager owner)
Constructor; supply table and action.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearForeignKey(ForeignKey fk)
Clear a circular foreign key.void
clearRelationId(Column col)
Clear a circular relation id.void
copyInto(RowImpl row, boolean whereOnly)
Copy all values from this row into the given one.protected java.lang.String
generateSQL(DBDictionary dict)
Generate the SQL for this row; the result of this method is cached.java.lang.Object
getFailedObject()
This implementation does not track failed objects.ColumnIO
getForeignKeyIO(ForeignKey fk)
Return the I/O information for the given set foreign key.OpenJPAStateManager
getForeignKeySet(ForeignKey fk)
Return the value for the given foreign key.OpenJPAStateManager
getForeignKeyWhere(ForeignKey fk)
Return the value for the given foreign key.int
getIndex()
The index of this row in ordered row list.OpenJPAStateManager
getPrimaryKey()
This implementation does not track primary keys.RelationId
getRelationIdCallback(Column col)
Return the recorded callbacks for the given relation id column.OpenJPAStateManager
getRelationIdSet(Column col)
Return the recorded value for the given relation id column.boolean
isDependent()
Mark this row as dependent on some other row.protected RowImpl
newInstance(Column[] cols, int action)
Return a new row.void
setDependent(boolean dependent)
Mark this row as dependent on some other row.void
setFailedObject(java.lang.Object failed)
This implementation does not track failed objects.void
setForeignKey(ForeignKey fk, ColumnIO io, OpenJPAStateManager sm)
Set the value of the given foreign key to the given object.void
setForeignKey(ForeignKey fk, OpenJPAStateManager sm)
Set the value of the given foreign key to the given object.void
setIndex(int idx)
The index of this row in ordered row list.protected void
setObject(Column col, java.lang.Object val, int metaType, boolean overrideDefault)
All set column methods delegate to this one.void
setPrimaryKey(ColumnIO io, OpenJPAStateManager sm)
Set the primary key to represent the given object.void
setPrimaryKey(OpenJPAStateManager sm)
Set the primary key to represent the given object.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.java.lang.String
toString()
void
whereForeignKey(ForeignKey fk, OpenJPAStateManager sm)
Set the foreign key equality criteria to link to the given object.void
wherePrimaryKey(OpenJPAStateManager sm)
Set the primary key equality criteria for this row.-
Methods inherited from class org.apache.openjpa.jdbc.sql.RowImpl
canSet, canSetAny, clone, flush, flush, getAction, getColumns, getParameterCount, getSet, getSQL, getTable, getTypes, getVals, getWhere, isFlushed, isValid, setArray, setAsciiStream, setBigDecimal, setBigInteger, setBinaryStream, setBlob, setBoolean, setByte, setBytes, setCalendar, setChar, setCharacterStream, setClob, setDate, setDate, setDouble, setFloat, setFlushed, setInt, setLocale, setLong, setNull, setNull, setNumber, setObject, setRaw, setShort, setString, setTime, setTimestamp, setValid, whereArray, whereAsciiStream, whereBigDecimal, whereBigInteger, whereBinaryStream, whereBlob, whereBoolean, whereByte, whereBytes, whereCalendar, whereChar, whereCharacterStream, whereClob, whereDate, whereDate, whereDouble, whereFloat, whereInt, whereLocale, whereLong, whereNull, whereNumber, whereObject, whereObject, whereRaw, whereShort, whereString, whereTime, whereTimestamp
-
-
-
-
Constructor Detail
-
PrimaryRow
public PrimaryRow(Table table, int action, OpenJPAStateManager owner)
Constructor; supply table and action.
-
PrimaryRow
protected PrimaryRow(Column[] cols, int action, OpenJPAStateManager owner)
-
-
Method Detail
-
isDependent
public boolean isDependent()
Mark this row as dependent on some other row.- Overrides:
isDependent
in classRowImpl
-
setDependent
public void setDependent(boolean dependent)
Mark this row as dependent on some other row.
-
getIndex
public int getIndex()
The index of this row in ordered row list.
-
setIndex
public void setIndex(int idx)
The index of this row in ordered row list.
-
getFailedObject
public java.lang.Object getFailedObject()
Description copied from class:RowImpl
This implementation does not track failed objects.- Specified by:
getFailedObject
in interfaceRow
- Overrides:
getFailedObject
in classRowImpl
-
setFailedObject
public void setFailedObject(java.lang.Object failed)
Description copied from class:RowImpl
This implementation does not track failed objects.- Specified by:
setFailedObject
in interfaceRow
- Overrides:
setFailedObject
in classRowImpl
-
getPrimaryKey
public OpenJPAStateManager getPrimaryKey()
Description copied from class:RowImpl
This implementation does not track primary keys.- Specified by:
getPrimaryKey
in interfaceRow
- Overrides:
getPrimaryKey
in classRowImpl
-
setPrimaryKey
public void setPrimaryKey(OpenJPAStateManager sm) throws java.sql.SQLException
Description copied from interface:Row
Set the primary key to represent the given object.- Specified by:
setPrimaryKey
in interfaceRow
- Overrides:
setPrimaryKey
in classRowImpl
- Throws:
java.sql.SQLException
-
setPrimaryKey
public void setPrimaryKey(ColumnIO io, OpenJPAStateManager sm)
Description copied from interface:Row
Set the primary key to represent the given object.- Specified by:
setPrimaryKey
in interfaceRow
- Overrides:
setPrimaryKey
in classRowImpl
- Parameters:
io
- information on which columns are settable; may be null
-
wherePrimaryKey
public void wherePrimaryKey(OpenJPAStateManager sm) throws java.sql.SQLException
Description copied from interface:Row
Set the primary key equality criteria for this row.- Specified by:
wherePrimaryKey
in interfaceRow
- Overrides:
wherePrimaryKey
in classRowImpl
- Throws:
java.sql.SQLException
-
getForeignKeyIO
public ColumnIO getForeignKeyIO(ForeignKey fk)
Return the I/O information for the given set foreign key.
-
getForeignKeySet
public OpenJPAStateManager getForeignKeySet(ForeignKey fk)
Return the value for the given foreign key. Values not needed for constraint analyses are not recorded.
-
getForeignKeyWhere
public OpenJPAStateManager getForeignKeyWhere(ForeignKey fk)
Return the value for the given foreign key. Values not needed for constraint analyses are not recorded.
-
setForeignKey
public void setForeignKey(ForeignKey fk, OpenJPAStateManager sm) throws java.sql.SQLException
Description copied from interface:Row
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.- Specified by:
setForeignKey
in interfaceRow
- Overrides:
setForeignKey
in classRowImpl
- Throws:
java.sql.SQLException
-
setForeignKey
public void setForeignKey(ForeignKey fk, ColumnIO io, OpenJPAStateManager sm) throws java.sql.SQLException
Description copied from interface:Row
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.- Specified by:
setForeignKey
in interfaceRow
- Overrides:
setForeignKey
in classRowImpl
io
- information on which columns are settable; may be null- Throws:
java.sql.SQLException
-
whereForeignKey
public void whereForeignKey(ForeignKey fk, OpenJPAStateManager sm) throws java.sql.SQLException
Description copied from interface:Row
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.- Specified by:
whereForeignKey
in interfaceRow
- Overrides:
whereForeignKey
in classRowImpl
- Throws:
java.sql.SQLException
-
clearForeignKey
public void clearForeignKey(ForeignKey fk) throws java.sql.SQLException
Description copied from class:RowImpl
Clear a circular foreign key.- Overrides:
clearForeignKey
in classRowImpl
- Throws:
java.sql.SQLException
-
getRelationIdSet
public OpenJPAStateManager getRelationIdSet(Column col)
Return the recorded value for the given relation id column. Only values that are dependent on a new, unflushed auto-assigned instance are recorded.
-
getRelationIdCallback
public RelationId getRelationIdCallback(Column col)
Return the recorded callbacks for the given relation id column. Only values that are dependent on a new, unflushed auto-assigned instance are recorded.
-
setRelationId
public void setRelationId(Column col, OpenJPAStateManager sm, RelationId rel) throws java.sql.SQLException
Description copied from interface:Row
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.- Specified by:
setRelationId
in interfaceRow
- Overrides:
setRelationId
in classRowImpl
- Throws:
java.sql.SQLException
-
clearRelationId
public void clearRelationId(Column col) throws java.sql.SQLException
Description copied from class:RowImpl
Clear a circular relation id.- Overrides:
clearRelationId
in classRowImpl
- Throws:
java.sql.SQLException
-
setObject
protected void setObject(Column col, java.lang.Object val, int metaType, boolean overrideDefault) throws java.sql.SQLException
Description copied from class:RowImpl
All set column methods delegate to this one. Set the given object unless this is an insert and the given column is auto-assigned.
-
generateSQL
protected java.lang.String generateSQL(DBDictionary dict)
Description copied from class:RowImpl
Generate the SQL for this row; the result of this method is cached.- Overrides:
generateSQL
in classRowImpl
-
newInstance
protected RowImpl newInstance(Column[] cols, int action)
Description copied from class:RowImpl
Return a new row.- Overrides:
newInstance
in classRowImpl
-
copyInto
public void copyInto(RowImpl row, boolean whereOnly)
Description copied from class:RowImpl
Copy all values from this row into the given one.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-