Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Development Framework Model and Business Components Java API Reference 10g Release 3 (10.1.3) B16005-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.jbo
Class RowMatch

`java.lang.Object
oracle.jbo.RowMatch`

All Implemented Interfaces:
  java.io.Serializable

Direct Known Subclasses:
  RowQualifier

public class RowMatch
extends java.lang.Object
implements java.io.Serializable

`RowMatch` is used to apply in-memory a qualifying expression to rows in memory. The user specifies a SQL expression.

A RowMatch may be used stand-alone or used a qualifying RowMatch for a ViewObject. To use it stand-alone, one would create a RowMatch. Then, to see if a `Row` qualifies, one would invoke `rowQualifies(Row)`. Here is an example:

        RowMatch rowMatch = new RowMatch("Deptno = 30");

        if (rowMatch.rowQualifies(row))
        {
           System.out.println("We have a row whose Deptno is 30");
        }

To use a `RowMatch` for a ViewObject, invoke `ViewObject.setRowMatch(RowMatch)`. Rows will be qualified in-memory.

`RowMatch` differs from the where-clause of a database query statement mainly in that one should use row's attribute names as opposed to the database column names. Note that database column names are by default case-insensitive, while attribute names are case-sensitive.

Hence, to qualify for EmpView rows whose Deptno attribute value is 30, one can use the following where-clause in his query statement:

        DEPTNO = 30

To use the same qualification in-memory, one would create a `RowMatch` with

        Deptno = 30

Where-clause qualfication only applies to rows already exsiting in the database table. `RowMatch` will apply to rows as they are read from database query as well. Additionally, `RowMatch` is applied to rows that are created because of view link consistency.

View link consistency allows a `RowSet` to see new rows (unposted) created by another `RowSet`. Internally, when a new row is created by the other RowSet and the row's primary key is set, the original RowSet (if view link cosnsistency is on) receives an event indicating a new row has been created. This RowSet creates a row and inserts it in its collection. Before this copy row is inserted, it is tested against the view object's `RowMatch`. Only if the row qualifies will it be inserted.

If a qualification can be expressed in a query's where-clause, one should use the where-clause, because database will skip unqualifying rows. If one relies solely on the RowMatch for in-memory qualification, he may incur unnecessary performance overhead, because rows will be read from database query and formed in memory.

Unlike a where-clause, a RowMatch can evaluate expression involving transient attributes and not-yet-posted attribute values.

RowMatch is able to handle where-clause parameters in its expression. Assuming oracle number binding style for example, one can specify the following RowMatch:

        RowMatch rowMatch = new RowMatch("Deptno = :1");
        ViewObject vo;
        Row row;

        ...
        vo.setRowMatch(rowMatch);
        vo.executeQuery();

        // When evaluating each row for qualification, the where-clause
        // parameter of index 0 (where-clause param indices are 0 based)
        // will be used to see if it equals the Deptno attr value.
        while ((row = vo.next()) != null)
        {
           System.out.println("This row's Deptno is " + vo.getWhereClauseParam(0));
        }

RowMatch is also able to access variable values. To do so, one would use ":<variable-name>" in the expression. For example:

        RowMatch rowMatch = new RowMatch("Deptno = :myVariable");

When the RowMatch is used for a ViewObject, the ViewObject's variable manager will be asked to return the value of the variable. If the RowMatch is being used stand-alone, the row's owner (through the `getStructureDef()` call on the `Row` interface) is asked for the variable value. In this case, the owner object must implement the `oracle.jbo.RowMatchBindValueSupplier` interface.

Since:
  JDeveloper 10.1.3
See Also:
  `Row`, `RowMatchBindValueSupplier`, Serialized Form

Constructor Summary
`RowMatch()`
`RowMatch(java.lang.String whereClause)`

Method Summary
`boolean` | `equals(java.lang.Object o)`
`JIParserNode` | `getParsedExpr()`
`java.lang.Object` | `getVariableVal(Row row, java.lang.String varName)`
`java.lang.String` | `getWhereClause()`
`boolean` | `rowQualifies(Row row)`
`void` | `setWhereClause(java.lang.String whereClause)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### RowMatch

    public RowMatch()

### RowMatch

    public RowMatch(java.lang.String whereClause)

Method Detail

### getWhereClause

    public java.lang.String getWhereClause()

### setWhereClause

    public void setWhereClause(java.lang.String whereClause)

### getParsedExpr

    public JIParserNode getParsedExpr()

### rowQualifies

    public boolean rowQualifies(Row row)

### getVariableVal

    public java.lang.Object getVariableVal(Row row,
                                           java.lang.String varName)

### equals

    public boolean equals(java.lang.Object o)

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Application Development Framework Model and Business Components Java API Reference 10g Release 3 (10.1.3) B16005-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 1997, 2005, Oracle. All rights reserved.