Package org.apache.openjpa.jdbc.sql
Class PrimaryRow
java.lang.Object
org.apache.openjpa.jdbc.sql.RowImpl
org.apache.openjpa.jdbc.sql.PrimaryRow
Primary table row that tracks foreign keys and auto-inc columns.
- Author:
- Abe White
-
Field Summary
Fields inherited from interface org.apache.openjpa.jdbc.sql.Row
ACTION_DELETE, ACTION_INSERT, ACTION_UNKNOWN, ACTION_UPDATE -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPrimaryRow(Column[] cols, int action, OpenJPAStateManager owner) PrimaryRow(Table table, int action, OpenJPAStateManager owner) Constructor; supply table and action. -
Method Summary
Modifier and TypeMethodDescriptionvoidClear a circular foreign key.voidclearRelationId(Column col) Clear a circular relation id.voidCopy all values from this row into the given one.protected StringgenerateSQL(DBDictionary dict) Generate the SQL for this row; the result of this method is cached.This implementation does not track failed objects.Return the I/O information for the given set foreign key.Return the value for the given foreign key.Return the value for the given foreign key.intgetIndex()The index of this row in ordered row list.This implementation does not track primary keys.Return the recorded callbacks for the given relation id column.getRelationIdSet(Column col) Return the recorded value for the given relation id column.booleanMark this row as dependent on some other row.protected RowImplnewInstance(Column[] cols, int action) Return a new row.voidsetDependent(boolean dependent) Mark this row as dependent on some other row.voidsetFailedObject(Object failed) This implementation does not track failed objects.voidsetForeignKey(ForeignKey fk, ColumnIO io, OpenJPAStateManager sm) Set the value of the given foreign key to the given object.voidSet the value of the given foreign key to the given object.voidsetIndex(int idx) The index of this row in ordered row list.protected voidAll set column methods delegate to this one.voidsetPrimaryKey(ColumnIO io, OpenJPAStateManager sm) Set the primary key to represent the given object.voidSet the primary key to represent the given object.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.toString()voidSet the foreign key equality criteria to link to the given object.voidSet 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 Details
-
PrimaryRow
Constructor; supply table and action. -
PrimaryRow
-
-
Method Details
-
isDependent
public boolean isDependent()Mark this row as dependent on some other row.- Overrides:
isDependentin 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
Description copied from class:RowImplThis implementation does not track failed objects.- Specified by:
getFailedObjectin interfaceRow- Overrides:
getFailedObjectin classRowImpl
-
setFailedObject
Description copied from class:RowImplThis implementation does not track failed objects.- Specified by:
setFailedObjectin interfaceRow- Overrides:
setFailedObjectin classRowImpl
-
getPrimaryKey
Description copied from class:RowImplThis implementation does not track primary keys.- Specified by:
getPrimaryKeyin interfaceRow- Overrides:
getPrimaryKeyin classRowImpl
-
setPrimaryKey
Description copied from interface:RowSet the primary key to represent the given object.- Specified by:
setPrimaryKeyin interfaceRow- Overrides:
setPrimaryKeyin classRowImpl- Throws:
SQLException
-
setPrimaryKey
Description copied from interface:RowSet the primary key to represent the given object.- Specified by:
setPrimaryKeyin interfaceRow- Overrides:
setPrimaryKeyin classRowImpl- Parameters:
io- information on which columns are settable; may be null
-
wherePrimaryKey
Description copied from interface:RowSet the primary key equality criteria for this row.- Specified by:
wherePrimaryKeyin interfaceRow- Overrides:
wherePrimaryKeyin classRowImpl- Throws:
SQLException
-
getForeignKeyIO
Return the I/O information for the given set foreign key. -
getForeignKeySet
Return the value for the given foreign key. Values not needed for constraint analyses are not recorded. -
getForeignKeyWhere
Return the value for the given foreign key. Values not needed for constraint analyses are not recorded. -
setForeignKey
Description copied from interface:RowSet 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:
setForeignKeyin interfaceRow- Overrides:
setForeignKeyin classRowImpl- Throws:
SQLException
-
setForeignKey
Description copied from interface:RowSet 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:
setForeignKeyin interfaceRow- Overrides:
setForeignKeyin classRowImplio- information on which columns are settable; may be null- Throws:
SQLException
-
whereForeignKey
Description copied from interface:RowSet 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:
whereForeignKeyin interfaceRow- Overrides:
whereForeignKeyin classRowImpl- Throws:
SQLException
-
clearForeignKey
Description copied from class:RowImplClear a circular foreign key.- Overrides:
clearForeignKeyin classRowImpl- Throws:
SQLException
-
getRelationIdSet
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
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
Description copied from interface:RowSet 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:
setRelationIdin interfaceRow- Overrides:
setRelationIdin classRowImpl- Throws:
SQLException
-
clearRelationId
Description copied from class:RowImplClear a circular relation id.- Overrides:
clearRelationIdin classRowImpl- Throws:
SQLException
-
setObject
protected void setObject(Column col, Object val, int metaType, boolean overrideDefault) throws SQLException Description copied from class:RowImplAll set column methods delegate to this one. Set the given object unless this is an insert and the given column is auto-assigned.- Overrides:
setObjectin classRowImpl- Throws:
SQLException
-
generateSQL
Description copied from class:RowImplGenerate the SQL for this row; the result of this method is cached.- Overrides:
generateSQLin classRowImpl
-
newInstance
Description copied from class:RowImplReturn a new row.- Overrides:
newInstancein classRowImpl
-
copyInto
Description copied from class:RowImplCopy all values from this row into the given one. -
toString
-