Class PrimaryRow

  • All Implemented Interfaces:
    Cloneable, Row

    public class PrimaryRow
    extends RowImpl
    Primary table row that tracks foreign keys and auto-inc columns.
    Author:
    Abe White
    • Method Detail

      • isDependent

        public boolean isDependent()
        Mark this row as dependent on some other row.
        Overrides:
        isDependent in class RowImpl
      • 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.
      • 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 interface Row
        Overrides:
        setPrimaryKey in class RowImpl
        Parameters:
        io - information on which columns are settable; may be null
      • 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,
                                  ColumnIO io,
                                  OpenJPAStateManager sm)
                           throws 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 interface Row
        Overrides:
        setForeignKey in class RowImpl
        io - information on which columns are settable; may be null
        Throws:
        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 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 interface Row
        Overrides:
        setRelationId in class RowImpl
        Throws:
        SQLException
      • setObject

        protected void setObject​(Column col,
                                 Object val,
                                 int metaType,
                                 boolean overrideDefault)
                          throws 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.
        Overrides:
        setObject in class RowImpl
        Throws:
        SQLException
      • generateSQL

        protected 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 class RowImpl
      • copyInto

        public void copyInto​(RowImpl row,
                             boolean whereOnly)
        Description copied from class: RowImpl
        Copy all values from this row into the given one.
        Overrides:
        copyInto in class RowImpl
        whereOnly - if true, only copy where conditions