|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.5.0) E10653-06 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.jbo.ExprEval
oracle.jbo.RowMatch
public class RowMatch
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.
Row
, RowMatchBindValueSupplier
, Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class oracle.jbo.ExprEval |
---|
ExprEval.Privilege |
Field Summary |
---|
Fields inherited from interface oracle.jbo.JboReservedVarNames |
---|
RESERVED_VAR_AGG_AVG, RESERVED_VAR_AGG_COUNT, RESERVED_VAR_AGG_MAX, RESERVED_VAR_AGG_MIN, RESERVED_VAR_AGG_SUM, RESERVED_VAR_AGGVAL_PREFIX, RESERVED_VAR_STRUCTURE_DEF |
Fields inherited from interface oracle.jbo.expr.JIReservedVarNames |
---|
RESERVED_VAR_VALUE |
Constructor Summary | |
---|---|
RowMatch() |
|
RowMatch(java.lang.String whereClause) |
|
RowMatch(java.lang.String whereClause, JIParserHelper ph) |
Method Summary | |
---|---|
java.lang.String |
getWhereClause() |
boolean |
objQualifies(ExprValueSupplier valSupplier) |
boolean |
rowQualifies(Row row) |
void |
setWhereClause(java.lang.String whereClause) |
Methods inherited from class oracle.jbo.ExprEval |
---|
createRowValueSupplier, equals, evaluate, evaluate, evaluateForRow, evaluateForRow, getExprHasReturn, getExprIdentifier, getExprMethodVal, getExprPrivilege, getExprStr, getExprStyle, getMethodKind, getParsedExpr, getParsedScript, getRowVal, invokeMethodForRow, setExprHasReturn, setExprPrivilege, setExprStr, setParsedExpr, setRowVal |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RowMatch()
public RowMatch(java.lang.String whereClause)
public RowMatch(java.lang.String whereClause, JIParserHelper ph)
Method Detail |
---|
public java.lang.String getWhereClause()
public void setWhereClause(java.lang.String whereClause)
public boolean rowQualifies(Row row)
public boolean objQualifies(ExprValueSupplier valSupplier)
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.5.0) E10653-06 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |