Class RowImpl

    • Constructor Detail

      • RowImpl

        public RowImpl​(Table table,
                       int action)
        Constructor.
        Parameters:
        table - the table the row is a part of
        action - the action on the row
      • RowImpl

        protected RowImpl​(Column[] cols,
                          int action)
    • Method Detail

      • getTable

        public Table getTable()
        Description copied from interface: Row
        Return the table for this row.
        Specified by:
        getTable in interface Row
      • getColumns

        public Column[] getColumns()
      • getAction

        public int getAction()
        Description copied from interface: Row
        Return the action for this row.
        Specified by:
        getAction in interface Row
      • isValid

        public boolean isValid()
        Description copied from interface: Row
        Whether this row has information set on it.
        Specified by:
        isValid in interface Row
      • setValid

        public void setValid​(boolean valid)
        Description copied from interface: Row
        Whether this row has information set on it.
        Specified by:
        setValid in interface Row
      • getFailedObject

        public Object getFailedObject()
        This implementation does not track failed objects.
        Specified by:
        getFailedObject in interface Row
      • setFailedObject

        public void setFailedObject​(Object failed)
        This implementation does not track failed objects.
        Specified by:
        setFailedObject in interface Row
      • isDependent

        public boolean isDependent()
        Secondary rows cannot be dependent.
      • getSet

        public Object getSet​(Column col)
        Return the value set for update on the given column.
      • getWhere

        public Object getWhere​(Column col)
        Return the value set for where on the given column.
      • setForeignKey

        public void setForeignKey​(ForeignKey fk,
                                  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
        Throws:
        SQLException
      • 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
        io - information on which columns are settable; may be null
        Throws:
        SQLException
      • whereForeignKey

        public void whereForeignKey​(ForeignKey fk,
                                    OpenJPAStateManager sm)
                             throws 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 interface Row
        Throws:
        SQLException
      • canSetAny

        protected boolean canSetAny​(ColumnIO io,
                                    int i,
                                    boolean nullValue)
        Return true if any of the given column indexes are settable.
      • canSet

        protected boolean canSet​(ColumnIO io,
                                 int i,
                                 boolean nullValue)
        Return true if the given column index is settable.
      • 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
        Throws:
        SQLException
      • setBoolean

        public void setBoolean​(Column col,
                               boolean val)
                        throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setBoolean in interface Row
        Throws:
        SQLException
      • setByte

        public void setByte​(Column col,
                            byte val)
                     throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setByte in interface Row
        Throws:
        SQLException
      • setBytes

        public void setBytes​(Column col,
                             byte[] val)
                      throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setBytes in interface Row
        Throws:
        SQLException
      • setChar

        public void setChar​(Column col,
                            char val)
                     throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setChar in interface Row
        Throws:
        SQLException
      • setDouble

        public void setDouble​(Column col,
                              double val)
                       throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setDouble in interface Row
        Throws:
        SQLException
      • setFloat

        public void setFloat​(Column col,
                             float val)
                      throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setFloat in interface Row
        Throws:
        SQLException
      • setInt

        public void setInt​(Column col,
                           int val)
                    throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setInt in interface Row
        Throws:
        SQLException
      • setLong

        public void setLong​(Column col,
                            long val)
                     throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setLong in interface Row
        Throws:
        SQLException
      • setNull

        public void setNull​(Column col)
                     throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setNull in interface Row
        Throws:
        SQLException
      • setNull

        public void setNull​(Column col,
                            boolean overrideDefault)
                     throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setNull in interface Row
        overrideDefault - whether to set this column to null even if this is an insert and the column has a default
        Throws:
        SQLException
      • setRaw

        public void setRaw​(Column col,
                           String val)
                    throws SQLException
        Description copied from interface: Row
        Set a DB understood value for the given column. The value will not be parameterized and instead be inserted as raw SQL.
        Specified by:
        setRaw in interface Row
        Throws:
        SQLException
      • setShort

        public void setShort​(Column col,
                             short val)
                      throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setShort in interface Row
        Throws:
        SQLException
      • setObject

        public void setObject​(Column col,
                              Object val)
                       throws SQLException
        Description copied from interface: Row
        Set the value of the given column in this row.
        Specified by:
        setObject in interface Row
        Parameters:
        col - the column being set
        val - the value for the column
        Throws:
        SQLException
      • whereArray

        public void whereArray​(Column col,
                               Array val)
                        throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereArray in interface Row
        Throws:
        SQLException
      • whereBlob

        public void whereBlob​(Column col,
                              Blob val)
                       throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereBlob in interface Row
        Throws:
        SQLException
      • whereBoolean

        public void whereBoolean​(Column col,
                                 boolean val)
                          throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereBoolean in interface Row
        Throws:
        SQLException
      • whereByte

        public void whereByte​(Column col,
                              byte val)
                       throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereByte in interface Row
        Throws:
        SQLException
      • whereBytes

        public void whereBytes​(Column col,
                               byte[] val)
                        throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereBytes in interface Row
        Throws:
        SQLException
      • whereChar

        public void whereChar​(Column col,
                              char val)
                       throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereChar in interface Row
        Throws:
        SQLException
      • whereClob

        public void whereClob​(Column col,
                              Clob val)
                       throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereClob in interface Row
        Throws:
        SQLException
      • whereDate

        public void whereDate​(Column col,
                              Date val)
                       throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereDate in interface Row
        Throws:
        SQLException
      • whereDouble

        public void whereDouble​(Column col,
                                double val)
                         throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereDouble in interface Row
        Throws:
        SQLException
      • whereFloat

        public void whereFloat​(Column col,
                               float val)
                        throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereFloat in interface Row
        Throws:
        SQLException
      • whereInt

        public void whereInt​(Column col,
                             int val)
                      throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereInt in interface Row
        Throws:
        SQLException
      • whereLong

        public void whereLong​(Column col,
                              long val)
                       throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereLong in interface Row
        Throws:
        SQLException
      • whereLocale

        public void whereLocale​(Column col,
                                Locale val)
                         throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereLocale in interface Row
        Throws:
        SQLException
      • whereNull

        public void whereNull​(Column col)
                       throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereNull in interface Row
        Throws:
        SQLException
      • whereNumber

        public void whereNumber​(Column col,
                                Number val)
                         throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereNumber in interface Row
        Throws:
        SQLException
      • whereRaw

        public void whereRaw​(Column col,
                             String val)
                      throws SQLException
        Description copied from interface: Row
        Set a DB understood where condition for the given column. The value will not be parameterized and instead be inserted as raw SQL.
        Specified by:
        whereRaw in interface Row
        Throws:
        SQLException
      • whereShort

        public void whereShort​(Column col,
                               short val)
                        throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereShort in interface Row
        Throws:
        SQLException
      • whereString

        public void whereString​(Column col,
                                String val)
                         throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereString in interface Row
        Throws:
        SQLException
      • whereObject

        public void whereObject​(Column col,
                                Object val)
                         throws SQLException
        Description copied from interface: Row
        Set an equality condition on the value of the given column in this row.
        Specified by:
        whereObject in interface Row
        Parameters:
        col - the column being set
        val - the value for the column
        Throws:
        SQLException
      • setObject

        protected void setObject​(Column col,
                                 Object val,
                                 int metaType,
                                 boolean overrideDefault)
                          throws SQLException
        All set column methods delegate to this one. Set the given object unless this is an insert and the given column is auto-assigned.
        Throws:
        SQLException
      • getSQL

        public String getSQL​(DBDictionary dict)
        Return the SQL for the operation on this row.
      • generateSQL

        protected String generateSQL​(DBDictionary dict)
        Generate the SQL for this row; the result of this method is cached.
      • getParameterCount

        public int getParameterCount()
        The number of parameters that will be set for this row.
      • clone

        public Object clone()
        Performs a proper deep clone.
        Overrides:
        clone in class Object
      • newInstance

        protected RowImpl newInstance​(Column[] cols,
                                      int action)
        Return a new row.
      • copyInto

        public void copyInto​(RowImpl row,
                             boolean whereOnly)
        Copy all values from this row into the given one.
        Parameters:
        whereOnly - if true, only copy where conditions
      • getVals

        public Object[] getVals()
      • getTypes

        public int[] getTypes()
      • isFlushed

        public boolean isFlushed()
      • setFlushed

        public void setFlushed​(boolean isFlushed)