|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.4.0) E10653-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractCollection<E> java.util.AbstractList<E> java.util.Vector oracle.jbo.ViewCriteria
public class ViewCriteria
A declarative representation for a View Object's WHERE clause fragment.
The following example of a user-defined function, demoCriteria
uses several methods in the ViewCriteria and
ViewCriteriaRow
classes to create and populate
criteria rows and to demonstrate "query-by-example." The
printViewObject is a helper function that executes the
View Object query and prints the results to the screen.
public static void demoCriteria(ApplicationModule appMod) { // Create and populate criteria rows to support query-by-example. ViewObject empView = appMod.createViewObject("Emp", "mypackage1.EmpView"); ViewCriteria vc = empView.createViewCriteria(); ViewCriteriaRow vcRow = vc.createViewCriteriaRow(); // ViewCriteriaRow attribute name is case-sensitive. // ViewCriteriaRow attribute value requires operator and value. // Note also single-quotes around string value. ViewCriteriaItem jobItem = vcRow.ensureCriteriaItem("Job"); jobItem.setOperator("="); jobItem.getValues().get(0).setValue("MANAGER"); vc.add(vcRow); vcRow = vc.createViewCriteriaRow(); ViewCriteriaItem salItem = vcRow.ensureCriteriaItem("Sal"); salItem.setOperator(">"); salItem.getValues().get(0).setValue(new Integer(2500)); vc.add(vcRow); empView.applyViewCriteria(vc); // Multiple rows are OR-ed in WHERE clause. System.out.println("Demo View Criteria"); // Should print employees that are MANAGER or have Sal > 2500 QueryDemo.printViewObject(empView); } public static void printViewObject(ViewObject vo) { // Execute the query, print results to the screen. vo.executeQuery(); // Print the View Object's query System.out.println("Query: " + vo.getQuery()); while (vo.hasNext()) { Row row = vo.next(); String rowDataStr = ""; // How many attributes (columns) is the View Object using? int numAttrs = vo.getAttributeCount(); // Column numbers start with 0, not 1. for (int columnNo = 0; columnNo < numAttrs; columnNo++) { // See also Row.getAttribute(String name). Object attrData = row.getAttribute(columnNo); rowDataStr += (attrData + "\t"); } System.out.println(rowDataStr); } }
In the above code example, note that the View Object's
must be called to apply this ViewCriteria to the View Object.
ViewObject.applyViewCriteria(oracle.jbo.ViewCriteria)
Nested Class Summary | |
---|---|
class |
ViewCriteria.NestedViewCriteriaRow
|
Field Summary | |
---|---|
static java.lang.String |
BASE_QUERY_ALIAS_BASE
|
static int |
CRITERIA_MODE_CACHE
CRITERIA_MODE_... constants are used to specify
View Criteria mode. |
static int |
CRITERIA_MODE_QUERY
CRITERIA_MODE_... constants are used to specify
View Criteria mode. |
static java.lang.String |
FIND_MODE
|
static java.lang.String |
FIND_MODE_ITERATOR
|
protected java.util.ArrayList |
listeners
|
protected java.util.Hashtable |
mProperties
|
protected ViewCriteria |
mSavedState
|
protected VariableValueManager |
mVariableManager
|
static java.lang.String |
NESTED_QUERY_ALIAS_BASE
|
static java.lang.String |
NULL_VALUE
|
static java.lang.String |
ROOT_VC_NAME
|
static java.lang.String |
TEMP_VARIABLE
|
Fields inherited from class java.util.Vector |
---|
capacityIncrement, elementCount, elementData |
Fields inherited from class java.util.AbstractList |
---|
modCount |
Fields inherited from interface oracle.jbo.RowIterator |
---|
ITER_MODE_LAST_PAGE_FULL, ITER_MODE_LAST_PAGE_PARTIAL, SLOT_BEFORE_FIRST, SLOT_BEYOND_LAST, SLOT_DELETED, SLOT_VALID |
Fields inherited from interface oracle.jbo.ViewCriteriaComponent |
---|
VC_CONJ_AND, VC_CONJ_NOT, VC_CONJ_OR, VC_CONJ_UNION, VC_UPPER_COL_DEFAULT, VC_UPPER_COL_FALSE, VC_UPPER_COL_TRUE |
Constructor Summary | |
---|---|
ViewCriteria(StructureDef structureDef)
Creates an empty view criteria object. |
|
ViewCriteria(ViewCriteria parent,
java.lang.String structDefFullName)
Creates a nested view criteria object |
|
ViewCriteria(ViewObject viewObject)
Creates an empty view criteria object. |
Method Summary | |
---|---|
void |
activate(XMLElement node)
For internal use only. |
void |
add(int index,
java.lang.Object element)
|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int index,
java.util.Collection c)
|
void |
addElement(java.lang.Object obj)
|
void |
addListener(java.lang.Object target)
For internal use only. |
void |
addRow(ViewCriteriaRow newRow)
For internal use only. |
static java.lang.String |
addTableAliasSuffix(java.lang.String origAlias,
java.lang.String suffix)
For internal use only. |
boolean |
clausesCacheDisabled()
|
void |
clear()
|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
convertArrayToMap(java.lang.Object[] valuesArr)
|
protected java.lang.Object[] |
convertMapToArray(java.util.HashMap<java.lang.String,java.lang.Object> varsMap)
|
void |
copyFrom(ViewCriteria vc)
For internal use only. |
Row |
createAndInitRow(AttributeList nvp)
For internal use only. |
ViewCriteria |
createCriteria()
|
Key |
createKey(AttributeList nvp)
For internal use only. |
ViewCriteriaRow |
createNestedCriteriaRow(java.lang.String name,
ViewCriteria criteria)
Deprecated. |
Row |
createRow()
For internal use only. |
ViewCriteriaRow |
createSimpleRow(java.lang.String name)
Deprecated. |
ViewCriteriaRow |
createViewCriteriaRow()
Creates a new ViewCriteriaRow for this ViewCriteria. |
ViewCriteriaUsage |
createViewCriteriaUsage()
Creates a View Criteria reference to an existing view criteria |
void |
criteriaChanged()
When a filter value changes in the view criteria it is marked dirty and the criteria manager is notified so that the view criteria is marked for a fresh clause generation in the next cycle. |
VariableValueManager |
ensureVariableManager()
Returns this object's Variable Value Manager. |
java.util.Enumeration |
enumerateRowsInRange()
For internal use only. |
RowIterator |
findByAltKey(java.lang.String keyName,
Key key,
int maxNumOfRows,
boolean skipWhere)
For internal use only. |
Row[] |
findByEntity(int eRowHandle,
int maxNumOfRows)
For internal use only. |
Row[] |
findByKey(Key key,
int maxNumOfRows)
For internal use only. |
RowIterator |
findByViewCriteria(ViewCriteria criteria,
int maxNumOfRows,
int queryMode)
For internal use only. |
java.lang.Object |
findElementByName(java.lang.String elemName)
|
java.lang.Object |
findElementWithRelativeName(java.lang.String compName)
Find a view criteria element given a full path. |
ViewCriteriaItem |
findViewCriteriaItem(java.lang.String compName)
Deprecated. use findElementWithRelativeName(String) instead |
Row |
first()
For internal use only. |
boolean |
get1013CompatibilityMode()
With the 10.1.3 compatibility flag set to true, SQL fragment is allowed in the value argument in calls to ViewCriteriaRow.setAttribute() method. |
java.util.Collection<Variable> |
getAllBindVariables()
|
protected void |
getAllBindVariables(java.util.HashMap<java.lang.String,Variable> map)
The collection of bind variables that are used in this view criteria. |
Row[] |
getAllRowsInRange()
For internal use only. |
int |
getAttributeIndexOf(java.lang.String name)
For internal use only. |
CriteriaClauses |
getClauses()
For internal use only. |
int |
getConjunction()
Conjunction of a view criteria is used when nested view criteria are converted into where clauses. |
VariableValueManager |
getContextualVariableManager()
For internal use only. |
java.lang.String |
getCriteriaAlias(ViewCriteria vc)
For internal use only. |
int |
getCriteriaMode()
Gets the current View Criteria mode. |
Row |
getCurrentRow()
For internal use only. |
int |
getCurrentRowIndex()
For internal use only. |
int |
getCurrentRowSlot()
For internal use only. |
java.lang.String |
getDisplayName(LocaleContext locale)
Deprecated. Use getProperty(String, LocaleContext) instead. For the property name
argument pass ViewCriteriaHints.CRITERIA_DISPLAY_NAME . |
protected java.util.Hashtable |
getElementProperties(XMLElement propertiesNode)
For internal use only. |
java.lang.Object |
getExtendedDataForVarName(java.lang.String varName)
For internal use only. |
int |
getExtendedDataOffset()
For internal use only. |
int |
getFetchedRowCount()
For internal use only. |
int |
getIterMode()
For internal use only Gets the iteration mode. |
protected java.util.ArrayList |
getListenersList()
For internal use only. |
java.util.Hashtable |
getLocalAndResourceProperties()
For internal use only. |
java.lang.String |
getLocaleName(LocaleContext locale,
java.lang.String sName)
For internal use only. |
java.lang.Class |
getMessageBundleClass()
|
java.lang.String |
getName()
Returns the name of this Variable Manager Owner. |
java.util.HashMap<java.lang.String,ViewCriteria> |
getNestedViewCriteria(java.util.HashMap<java.lang.String,ViewCriteria> criteriaMap)
For internal use only. |
ViewCriteria |
getParentViewCriteria()
|
java.util.Hashtable |
getProperties()
Gets the table of properties. |
java.util.Hashtable |
getProperties(LocaleContext context)
|
java.lang.Object |
getProperty(java.lang.String property)
Retrieves the specified property, if it exists. |
java.lang.Object |
getProperty(java.lang.String property,
LocaleContext locale)
|
int |
getRangeIndexOf(Row row)
For internal use only. |
int |
getRangeSize()
For internal use only. |
int |
getRangeStart()
For internal use only. |
ResourceBundleDef |
getResourceBundleDef()
|
protected void |
getResourcesFromBundle(LocaleContext locale,
java.util.HashMap map)
Get all resources from the resource bundle. |
java.lang.String |
getRootCriteriaRelativeName()
|
ViewCriteria |
getRootViewCriteria()
|
Row |
getRow(Key key)
For internal use only. |
Row |
getRowAtRangeIndex(int index)
For internal use only. |
int |
getRowCount()
For internal use only. |
int |
getRowCountInRange()
For internal use only. |
java.util.List |
getRows()
For internal use only. |
java.util.HashMap<java.lang.String,java.lang.Object> |
getSavedVariables()
For internal use only. |
StructureDef |
getStructureDef()
|
java.lang.String |
getStructureDefFullName()
|
int |
getUpperColumnsValue()
For internal use only. |
java.lang.String[] |
getUsedAttributeNames()
For internal use only. |
AttributeDef[] |
getUsedViewAttributes()
For internal use only. |
VariableValueManager |
getVariableManager()
Returns this object's current Variable Value Manager. |
ViewCriteriaManager |
getViewCriteriaManager()
|
ViewObject |
getViewObject()
Gets the View Object that owns the view criteria. |
ViewObject |
getViewObject(boolean getVoIfNested)
For internal use only. |
protected VariableManager |
getVoVariableManager()
For internal use only. |
boolean |
hasData()
For internal use only. |
boolean |
hasNext()
For internal use only. |
boolean |
hasPrevious()
For internal use only. |
boolean |
hasVariables()
For internal use only. |
void |
initName(java.lang.String name)
For internal use only. |
void |
insertElementAt(java.lang.Object obj,
int index)
|
void |
insertRow(Row row)
For internal use only. |
void |
insertRowAtRangeIndex(int index,
Row row)
For internal use only. |
boolean |
isAppliedIfJoinSatisfied()
For internal use only. |
boolean |
isCriteriaForQuery()
Returns a flag indicating whether the View Criteria is to be included in database query. |
boolean |
isCriteriaForRowMatch()
Returns a flag indicating whether the View Criteria is to be used for in-memory row filtering. |
boolean |
isDirty()
|
boolean |
isItemHolder()
For internal use only. |
boolean |
isRangeAtBottom()
For internal use only. |
boolean |
isRangeAtTop()
For internal use only. |
boolean |
isRowValidation()
For internal use only. |
boolean |
isSubQueryAliasEnabled()
For internal use only. |
static boolean |
isTemporaryVariable(Variable var)
For internal use only. |
boolean |
isTemporaryVariableBelongs(Variable var)
For internal use only. |
boolean |
isUpperColumns()
Upper column setting on a view criteria controls the default behavior of matching with case for all string type filter values used in the criteria items. |
boolean |
isUseAttributeFormatHint()
Deprecated. |
boolean |
isUseBindVarsOnly()
When a view criteria is set to bind vars only mode, the literal values are converted into temporary bind variables so that database and jdbc layers can use statement caching even when the literal values change. |
Row |
last()
For internal use only. |
void |
loadVOBindVariables(java.util.HashMap<java.lang.String,Variable> bindVarMap)
For internal use only. |
void |
mergeFrom(ViewCriteria vc)
For internal use only. |
Row |
next()
For internal use only. |
void |
passivate(XMLDocument doc,
XMLElement node)
For internal use only. |
protected void |
passivateElementProperties(XMLDocument doc,
XMLElement parentNode,
java.util.Hashtable props)
For internal use only. |
Row |
previous()
For internal use only. |
void |
putCriteriaAlias(ViewCriteria vc,
java.lang.String vcAlias)
For internal use only. |
java.lang.String |
putDefaultCriteriaAlias(ViewCriteria vc,
boolean isNested)
For internal use only. |
java.lang.Object |
refreshProperty(java.lang.String hintName)
For internal use only. |
java.lang.Object |
remove(int index)
|
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.Collection c)
|
void |
removeAllElements()
|
void |
removeCurrentRow()
For internal use only. |
Row |
removeCurrentRowAndRetain()
For internal use only. |
void |
removeCurrentRowFromCollection()
For internal use only. |
boolean |
removeElement(java.lang.Object obj)
|
void |
removeElementAt(int index)
|
void |
removeListener(java.lang.Object target)
For internal use only. |
void |
removeProperty(java.lang.String hintName)
Remove a property from the hash table maintained in the view criteria. |
protected void |
removeRange(int fromIndex,
int toIndex)
|
boolean |
removeRow(ViewCriteriaRow row)
For internal use only. |
void |
reset()
For internal use only. |
void |
resetCriteria()
Restore the View Criteria to the latest saved state. |
void |
resolve(ViewCriteriaResolver resolver)
For internal use only. |
boolean |
retainAll(java.util.Collection c)
|
void |
saveState()
Save the current state of the View Criteria which will be used to restore when resetCriteria is called. |
int |
scrollRange(int amount)
For internal use only. |
int |
scrollRangeTo(Row row,
int index)
For internal use only. |
int |
scrollToRangePage(int pageIndex)
For internal use only. |
java.lang.Object |
set(int index,
java.lang.Object element)
|
void |
set1013CompatibilityMode(boolean mode)
With the 10.1.3 compatibility flag set to true, SQL fragment is allowed in the value argument in calls to ViewCriteriaRow.setAttribute() method. |
void |
setAppliedIfJoinSatisfied(boolean bApplied)
For internal use only. |
void |
setClauses(CriteriaClauses clauses)
For internal use only. |
void |
setConjunction(int conj)
Conjunction of a view criteria is used when nested view criteria are converted into where clauses. |
void |
setConjunctionOnChildren(int conjunction)
For internal use only. |
void |
setCriteriaForQuery(boolean b)
Deprecated. Since JDeveloper 10.1.3. Use setCriteriaMode(int) instead |
void |
setCriteriaMode(int mode)
Sets the criteria mode which controls the manner in which the View Criteria will be used. |
boolean |
setCurrentRow(Row row)
For internal use only. |
boolean |
setCurrentRowAtRangeIndex(int index)
For internal use only. |
void |
setDirty(boolean isDirty)
For internal use only. |
void |
setElementAt(java.lang.Object obj,
int index)
|
void |
setExtendedDataForVarName(java.lang.String varName,
java.lang.Object extendedData)
For internal use only. |
void |
setExtendedDataOffset(int offset,
boolean bSkipIfAlreadySet)
For internal use only. |
void |
setIterMode(int mode)
For internal use only. |
void |
setKeepExtendedDataOffset(boolean keepExtendedDataOffset)
For internal use only. |
void |
setName(java.lang.String name)
Assign a name to the View Criteria instance. |
void |
setParent(java.lang.Object parent)
Change the owner of the view criteria. |
void |
setProperties(java.util.Hashtable properties)
Override all the properties currently defined on this view criteria. |
void |
setProperty(java.lang.String hintName,
java.lang.Object hintValue)
Set a property on view criteria. |
int |
setRangeSize(int size)
For internal use only. |
int |
setRangeStart(int start)
For internal use only. |
void |
setRowValidation(boolean flag)
For internal use only. |
void |
setSavedValuesInVariableMgr()
For internal use only. |
void |
setSavedVariables(java.util.HashMap<java.lang.String,java.lang.Object> savedVariablesMap)
For internal use only. |
void |
setStructureDefFullName(java.lang.String defName)
For internal use only. |
void |
setSubQueryAliasEnabled(boolean bEnabled)
For internal use only. |
void |
setUpperColumns(boolean b)
Upper column setting on a view criteria controls the default behavior of matching with case for all string type filter values used in the criteria items. |
void |
setUseAttributeFormatHint(boolean flag)
Deprecated. |
void |
setUseBindVarsForLiterals(boolean useBindVarsOnly)
Enables or Disables the usage of bind variables for literal values in view criteria. |
void |
setVariableManager(VariableValueManager variableManager)
For internal use only. |
void |
setViewCriteriaManager(ViewCriteriaManager manager)
For internal use only. |
void |
setViewObject(ViewObject vo)
For internal use only. |
java.lang.String |
toString()
|
void |
trimNoDataRows()
For internal use only. |
void |
useBindVarsOnly()
When a view criteria is set to bind vars only mode, the literal values are converted into temporary bind variables so that database and jdbc layers can use statement caching even when the literal values change. |
void |
validate()
Performs view criteria item required and selectively required validation |
void |
validate(java.util.HashMap whereParams)
Performs view criteria item required and selectively required validation. |
Methods inherited from class java.util.Vector |
---|
capacity, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, isEmpty, lastElement, lastIndexOf, lastIndexOf, setSize, size, subList, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
iterator, listIterator, listIterator |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
iterator, listIterator, listIterator |
Field Detail |
---|
protected transient java.util.Hashtable mProperties
protected transient ViewCriteria mSavedState
protected transient VariableValueManager mVariableManager
public static int CRITERIA_MODE_QUERY
CRITERIA_MODE_...
constants are used to specify
View Criteria mode. CRITERIA_MODE_QUERY
means that
the View Criteria will be used to augment the database query's
where-clause.
These constants may be OR'ed together. For example,
(CRITERIA_MODE_QUERY | CRITERIA_MODE_CACHE)
specifies that
the View Criteria will be used for the database query, as well as the
RowMatch (in-memory row filtering).
public static int CRITERIA_MODE_CACHE
CRITERIA_MODE_...
constants are used to specify
View Criteria mode. CRITERIA_MODE_CACHE
means that
the View Criteria will be used to produce a RowMatch
,
which is used for in-memory row filtering.
These constants may be OR'ed together. For example,
(CRITERIA_MODE_QUERY | CRITERIA_MODE_CACHE)
specifies that
the View Criteria will be used for the database query, as well as the
RowMatch (in-memory row filtering).
public static final java.lang.String TEMP_VARIABLE
public static final java.lang.String ROOT_VC_NAME
public static final java.lang.String FIND_MODE
public static final java.lang.String FIND_MODE_ITERATOR
public static final java.lang.String NULL_VALUE
public static final java.lang.String BASE_QUERY_ALIAS_BASE
public static final java.lang.String NESTED_QUERY_ALIAS_BASE
protected java.util.ArrayList listeners
Constructor Detail |
---|
public ViewCriteria(ViewObject viewObject)
viewObject
- the owner of this ViewCriteria
.public ViewCriteria(StructureDef structureDef)
structureDef
- the owner of this ViewCriteria
.public ViewCriteria(ViewCriteria parent, java.lang.String structDefFullName)
parent
- a reference to outer view criteria ownerstructDefFullName
- the structure defintion determines the
searchable attributes in this view criteria. This could be different
from the outer view criteria in the case of accessors.Method Detail |
---|
public java.lang.String getName()
VariableManagerOwner
getName
in interface VariableManagerOwner
public void initName(java.lang.String name)
public void setName(java.lang.String name)
name
- name of the view criteriapublic void setParent(java.lang.Object parent)
parent
- owner of the view criteriapublic final boolean hasData()
true
if the view criteria has any data that would
generate a where clause fragment, false
otherwise.public void setViewCriteriaManager(ViewCriteriaManager manager)
manager
- a ViewCriteriaManager
instancepublic ViewCriteriaManager getViewCriteriaManager()
public CriteriaClauses getClauses()
public void setClauses(CriteriaClauses clauses)
public void criteriaChanged()
public boolean isDirty()
true
if any structural changes are made to the view criteria.
It could be addition or removal of new view criteria items, rows. It could be
also be changes to the filter values held in view criteria items. This method
is also used to determine if this instance has transformed since it was
read from an XML defintion. If this method returns true
then
it is passivated when the view object is triggered for passivation for high
availability scenarios.public void setDirty(boolean isDirty)
isDirty
- true
if the view criteria has changed since it
was read from an XML definition. A view criteria that is created in-memory
is considered always dirty.public boolean isCriteriaForQuery()
If true
, when the View Criteria is translated into a
row qualification clause, it will use the name of the database column
to which the attribute is mapped.
true
)public boolean isCriteriaForRowMatch()
If the View Criteria is being used for in memory row filtering,
it should be used in conjunction with RowQualifier. See
for details.
ViewObjectImpl.setRowQualifier(oracle.jbo.server.RowQualifier)
public void setCriteriaForQuery(boolean b)
If true
, when the View Criteria is translated into a
row qualification clause, it will use the name of the database column
to which the attribute is mapped. If false
, the attribute
name is used as is.
If the View Criteria is being used for in memory row filtering,
it should be used in conjunction with RowQualifier. See
for details.
ViewObjectImpl.setRowQualifier(oracle.jbo.server.RowQualifier)
b
- the flag indicating whether the View Criteria is for database query
(true
) or for in memory row filtering (false
).public int getCriteriaMode()
See CRITERIA_MODE_QUERY
and CRITERIA_MODE_CACHE
for a description of supported modes.
The returning mode may be a combination (through bit-wise OR) multiple criteria modes.
public void setCriteriaMode(int mode)
See CRITERIA_MODE_QUERY
and CRITERIA_MODE_CACHE
for a description of supported modes.
The criteria mode constants may be OR'ed together.
For example, if this method is called with
(CRITERIA_MODE_QUERY | CRITERIA_MODE_CACHE)
, the View
Criteria will be used for the database query, as well as the
RowMatch (in-memory row filtering).
mode
- the new criteria mode.public void setAppliedIfJoinSatisfied(boolean bApplied)
bApplied
- flag to indicate if the view criteria needs
to be applied when join is activatedpublic boolean isAppliedIfJoinSatisfied()
true
if the view criteria needs
to be applied when join is activatedpublic void setViewObject(ViewObject vo)
vo
- the owner of the view criteriapublic void resolve(ViewCriteriaResolver resolver)
resolver
- used to locate the structure defpublic StructureDef getStructureDef()
public java.lang.String getStructureDefFullName()
public void setStructureDefFullName(java.lang.String defName)
defName
- the fully qualified name of the structure definition this criteria is based onpublic ViewObject getViewObject()
ViewObject
that owns this ViewCriteria
.public ViewObject getViewObject(boolean getVoIfNested)
getVoIfNested
argument is true, and if this view criteria
is a view criteria for a compound VC item,
this method will return the View Object of the view criteria that
contains this nested VC or compound VC item.
getVoIfNested
- true if the VO of the owning VC should be
retrieved if this VC is a nested VC or an item holder for
a VC item. If false, this method returns the owning view
object, which could be null for nested VC or item holder.
public ViewCriteria getParentViewCriteria()
null
value
is returned.public ViewCriteria getRootViewCriteria()
null
.public java.lang.String getRootCriteriaRelativeName()
public ViewCriteriaItem findViewCriteriaItem(java.lang.String compName)
findElementWithRelativeName(String)
instead
compName
- The fully qualified name of the view criteria item
ViewCriteriaItem
if found, null
otherwise.public java.lang.Object findElementWithRelativeName(java.lang.String compName)
getRootCriteriaRelativeName()
to obtain the path and use it later to find the element
compName
- The full path to the element relative to the root view criteria
public boolean isItemHolder()
true
if this view criteria is an item holder for a compound
view criteria item, false
otherwise.public int getAttributeIndexOf(java.lang.String name)
name
- the attribute name.
public java.lang.String[] getUsedAttributeNames()
public AttributeDef[] getUsedViewAttributes()
public ViewCriteriaRow createViewCriteriaRow()
ViewCriteriaRow
, an array for WHERE clause criteria.ViewCriteriaRow
public ViewCriteriaUsage createViewCriteriaUsage()
ViewCriteriaUsaga
instance that contains the
the information needed to resolve the view criteriaViewCriteriaUsage
public int getConjunction()
getConjunction
in interface ViewCriteriaComponent
public void setConjunction(int conj)
setConjunction
in interface ViewCriteriaComponent
conj
- public boolean isUpperColumns()
isUpperColumns
in interface ViewCriteriaComponent
public void setUpperColumns(boolean b)
setUpperColumns
in interface ViewCriteriaComponent
b
- set the ignore case property of this view criteriapublic int getUpperColumnsValue()
getUpperColumnsValue
in interface ViewCriteriaComponent
public void useBindVarsOnly()
public void setUseBindVarsForLiterals(boolean useBindVarsOnly)
useBindVarsOnly
- if true
enables bind variable usage, disables otherwisepublic boolean isUseBindVarsOnly()
true
if the view criteria is set to bind vars only modepublic void set1013CompatibilityMode(boolean mode)
mode
- true to allow SQL fragment in value argument of
ViewCriteriaRow.setAttribute(), false to unset.public boolean get1013CompatibilityMode()
true
if the view criteria should allow
10.1.3 style of usagepublic void loadVOBindVariables(java.util.HashMap<java.lang.String,Variable> bindVarMap)
bindVarMap
- the hashmap that will contain bind variable name
and reference to the required bind variablespublic java.util.Collection<Variable> getAllBindVariables()
protected void getAllBindVariables(java.util.HashMap<java.lang.String,Variable> map)
map
- the hashmap that will contain bind variable name
and reference to the bind variablespublic Row next()
next
in interface RowIterator
null
if there is no next row.public Row previous()
previous
in interface RowIterator
null
if there is no previous row.public Row first()
first
in interface RowIterator
null
if the row set is empty.public Row last()
last
in interface RowIterator
null
if the row set is empty.public void reset()
A subsequent invocation of next()
will cause the first
row to become the current row.
reset
in interface RowIterator
public boolean hasNext()
hasNext
in interface RowIterator
true
if there is next row.public boolean hasPrevious()
hasPrevious
in interface RowIterator
true
if there is previous row.public int getFetchedRowCount()
getFetchedRowCount
in interface RowIterator
public int getRowCount()
getRowCount
in interface RowIterator
public Row getRowAtRangeIndex(int index)
getRowAtRangeIndex
in interface RowIterator
index
- an integer in the range 0
to getRangeSize() - 1
.
null
if the index is out of range.public Row getCurrentRow()
getCurrentRow
in interface RowIterator
public int getCurrentRowIndex()
getCurrentRowIndex
in interface RowIterator
public int getCurrentRowSlot()
getCurrentRowSlot
in interface RowIterator
SLOT_
.
See SLOT_
constants in RowIterator
.public boolean setCurrentRow(Row row)
setCurrentRow
in interface RowIterator
row
- the new current row.
true
if the operation succeeded.public Row createAndInitRow(AttributeList nvp)
createViewCriteriaRow()
API.
Creates a new Row object, but does not insert it into the row set.
For ViewCriteria
, this method works just like
createRow()
.
createAndInitRow
in interface RowIterator
nvp
- not used.
public Row createRow()
createViewCriteriaRow()
API.
Creates a new Row object, but does not insert it into the row set.
createRow
in interface RowIterator
public void insertRow(Row row)
add(Object)
API.
Adds a row to the row set, before the current row.
This method sets the current row to the row just inserted.
With respect to eventing, this method call will generate
two events (of oracle.jbo.RowSetListener): rowInserted,
followed by navigated.
insertRow
in interface RowIterator
row
- the Row object to be added.public void removeCurrentRow()
removeElementAt(int)
API.
Removes the current Row object from the row set.
removeCurrentRow
in interface RowIterator
public void removeCurrentRowFromCollection()
removeElementAt(int)
API.
Removes the current Row object from the row set.
removeCurrentRowFromCollection
in interface RowIterator
public Row removeCurrentRowAndRetain()
removeElementAt(int)
API.
Removes the current Row object from the row set.
removeCurrentRowAndRetain
in interface RowIterator
public int setRangeSize(int size)
This method is a no-op for ViewCriteria. For a ViweCriteria, the range size is always -1.
setRangeSize
in interface RowIterator
size
- this parameter is not used.
-1
, which means that the range contains all rows.RowIterator.setRangeStart(int)
public int getRangeSize()
getRangeSize
in interface RowIterator
-1
, which means that the range contains all rows.public int getRangeStart()
The absolute index is 0-based, and is the row's index relative to the entire result set.
getRangeStart
in interface RowIterator
public int setRangeStart(int start)
Note that the index is 0-based. When you call setRangeStart(1), the range start will be positioned at the second table row.
Another behavior of setRangeStart (and also setRangeSize) is that it tries to position the range, so as to fill up the range as much as possible. For example, assume you have View Object vo focused on a table with four rows (A, B, C, D), and you execute the following code:
vo.setRangeStart(4); vo.setRangeSize(3); Row[] rows = vo.getAllRowsInRange();
In this case, rows contains the last 3 rows (B, C, D). When you call setRangeStart(4), it will try to position you at row 4. Since the index is 0-based, it finds that there is no row. Since the default range size is 1, it will position you to the last row (row index 3).
Then, when you call getRangeSize(3), it tries to fill up the range from the bottom. This is why you get (B, C, D).
setRangeStart
in interface RowIterator
start
- the absolute index of the new first row in the row set range.public int scrollRange(int amount)
scrollRange
in interface RowIterator
amount
- the number of rows to scroll.
A negative value scrolls upward.
public int scrollToRangePage(int pageIndex)
public int scrollRangeTo(Row row, int index)
scrollRangeTo
in interface RowIterator
row
- the row.index
- the row's new index.
public boolean setCurrentRowAtRangeIndex(int index)
setCurrentRowAtRangeIndex
in interface RowIterator
index
- the index of the new current row.
true
if the operation succeeded.public void insertRowAtRangeIndex(int index, Row row)
insertElementAt(Object, int)
API.
Adds a row to the row set at the given index. The index
is
relative to the range, i.e., index
of 0 would mean to insert
before the first row of the range. Allowed values for index
is 0 to range size. If index
equals range size, the row
is inserted right after the last row in the range. This method call does not
alter the current position of the iterator, nor does it affect the range
position.
insertRowAtRangeIndex
in interface RowIterator
index
- the point where row
is to be added.row
- the Row object to be added.public int getRangeIndexOf(Row row)
getRangeIndexOf
in interface RowIterator
row
- a Row object.
or -1
if the row is not in range.
row
(0 based).public int getRowCountInRange()
getRowCountInRange
in interface RowIterator
public boolean isRangeAtBottom()
isRangeAtBottom
in interface RowIterator
true
if the last row of the range is
the last row of the result set.public boolean isRangeAtTop()
isRangeAtTop
in interface RowIterator
true
if the first row of the range is
the first row of the result set.public java.util.Enumeration enumerateRowsInRange()
Enumeration
interface for the row set.
enumerateRowsInRange
in interface RowIterator
Enumeration
interface.public Row[] getAllRowsInRange()
getAllRowsInRange
in interface RowIterator
public Row getRow(Key key)
This operation is not supported by ViewCriteria. Calling this method
will throw InvalidOperException
.
getRow
in interface RowIterator
key
- a key.
InvalidOperException
- is thrown. ViewCriteria
does not support this operation.public Row[] findByKey(Key key, int maxNumOfRows)
This operation is not supported by ViewCriteria. Calling this method
will throw InvalidOperException
.
findByKey
in interface RowIterator
key
- the key to match.maxNumOfRows
- the maximum size of the array to return,
or -1 to return all rows.
InvalidOperException
- is thrown. ViewCriteria
does not support this operation.public RowIterator findByAltKey(java.lang.String keyName, Key key, int maxNumOfRows, boolean skipWhere)
This operation is not supported by ViewCriteria. Calling this method
will throw InvalidOperException
.
findByAltKey
in interface RowIterator
key
- the key to match.maxNumOfRows
- the maximum size of the array to return,
or -1 to return all rows.skipWhere
- A flag that controls whether, when a db query is issued
to get the matching row(s), the view object's current
where-clause is to be included in the query or not.keyName
- the name of the alternate key. If null
the primary key is specified, i.e., this function call
becomes equivalent to findByKey
with
skipWhere = false
.
InvalidOperException
- is thrown. ViewCriteria
does not support this operation.public RowIterator findByViewCriteria(ViewCriteria criteria, int maxNumOfRows, int queryMode)
InvalidOperException
.
findByViewCriteria
in interface RowIterator
criteria
- the View Criteria to be used to qualify View rows.maxNumOfRows
- the maximum size of the array to return,
or -1 to return all rows. If a value
other than -1 is specified and if the
specified number of rows is reached, the method
returns without performing any further operation.queryMode
- the mode in which qualify View rows are scanned.
See above for further info.
InvalidOperException
- is thrown. ViewCriteria
does not support this operation.public Key createKey(AttributeList nvp)
This operation is not supported by ViewCriteria. Calling this method
will throw InvalidOperException
.
createKey
in interface RowIterator
nvp
- the name value pair array.
InvalidOperException
- is thrown. ViewCriteria
does not support this operation.public Row[] findByEntity(int eRowHandle, int maxNumOfRows)
eRowHandle
.
This operation is not supported by ViewCriteria. Calling this method
will throw InvalidOperException
.
findByEntity
in interface RowIterator
eRowHandle
- the entity row handle.maxNumOfRows
- the maximum size of the row array to return,
or -1 to return all rows.
InvalidOperException
- is thrown. ViewCriteria
does not support this operation.public void setRowValidation(boolean flag)
This operation is not supported by ViewCriteria. Calling this method
will throw InvalidOperException
.
setRowValidation
in interface RowIterator
flag
- whether to turn row validation off or not.
InvalidOperException
- is thrown. ViewCriteria
does not support this operation.public boolean isRowValidation()
isRowValidation
in interface RowIterator
public int getIterMode()
As ViewCriteria always works with full range (range size -1), iteration mode is meaningless.
getIterMode
in interface RowIterator
RowIterator.ITER_MODE_LAST_PAGE_FULL
.public void setIterMode(int mode)
This method is a no-op for ViewCriteria. For a ViweCriteria, the range size is always -1, and thus iteration mode is meaningless.
setIterMode
in interface RowIterator
mode
- this parameter is not used.protected java.util.ArrayList getListenersList()
public void addListener(java.lang.Object target)
RowSetListener
.
addListener
in interface NavigatableRowIterator
target
- the listener to add.public void removeListener(java.lang.Object target)
RowSetListener
.
removeListener
in interface NavigatableRowIterator
target
- the listener to remove.public void trimNoDataRows()
public void setUseAttributeFormatHint(boolean flag)
flag
- controls the 904 behaviorpublic boolean isUseAttributeFormatHint()
public void copyFrom(ViewCriteria vc)
vc
- the view criteria that needs to be copiedpublic void mergeFrom(ViewCriteria vc)
vc
- A view criteria definition that has a specific overrides that
need to be appliedpublic java.lang.Object findElementByName(java.lang.String elemName)
public ViewCriteria createCriteria()
add(Object)
needs
to be invoked to make the returned instance a nested view criteriapublic void saveState()
public void resetCriteria()
saveState()
public void activate(XMLElement node)
node
- The XMLElement parent nodeprotected java.util.Hashtable getElementProperties(XMLElement propertiesNode)
propertiesNode
- the node that contains the properties
public void passivate(XMLDocument doc, XMLElement node)
node
- the XML node that represents the owner of the view criteriaprotected void passivateElementProperties(XMLDocument doc, XMLElement parentNode, java.util.Hashtable props)
doc
- xml documentparentNode
- the properties elementprops
- hash table containing the view criteria propertiespublic java.util.List getRows()
public void addRow(ViewCriteriaRow newRow)
add(Object)
API
Adds a row to the view criteria structure. Unwraps the nested
view criteria that are wrapped in a row interface before insert.
newRow
- a new row that is added to the structurepublic boolean removeRow(ViewCriteriaRow row)
remove(Object)
API
Removes a row from the view criteria structure.
row
- to be removed from the structure
true
if the passed row is found and removed from
the structurepublic ViewCriteriaRow createSimpleRow(java.lang.String name)
name
- of the view criteria row that is returned
public ViewCriteriaRow createNestedCriteriaRow(java.lang.String name, ViewCriteria criteria)
name
- ignoredcriteria
- the nested view criteria instance
public void validate()
public void validate(java.util.HashMap whereParams)
whereParams
- A Map of public java.lang.String toString()
toString
in class java.util.Vector
public static boolean isTemporaryVariable(Variable var)
var
- The variable to be checked
public static java.lang.String addTableAliasSuffix(java.lang.String origAlias, java.lang.String suffix)
origAlias
- the original alias for the tables if they were not part
of the subquerysuffix
- representing how deep the table is nested in the sub-query
public boolean isTemporaryVariableBelongs(Variable var)
var
- The variable to be checked
public java.util.HashMap<java.lang.String,ViewCriteria> getNestedViewCriteria(java.util.HashMap<java.lang.String,ViewCriteria> criteriaMap)
public boolean hasVariables()
getAllBindVariables()
API.
hasVariables
in interface VariableManagerOwnerBase
public VariableValueManager getVariableManager()
VariableManagerOwnerBase
null
if Variable Value Manager has
been initialized.
When a framework object is first created, its Variable Value Manager may be null. This method does not initialize (create) the Variable Value Manager.
in contrast, ensures
that the Variable Value Manager is initialized (created).
VariableManagerOwnerBase.ensureVariableManager()
getVariableManager
in interface VariableManagerOwnerBase
public void setVariableManager(VariableValueManager variableManager)
variableManager
- view criteria is assigned a variable manager
by the view object to set and get variable values.public VariableValueManager ensureVariableManager()
VariableManagerOwnerBase
ensureVariableManager
in interface VariableManagerOwnerBase
public java.lang.Class getMessageBundleClass()
getMessageBundleClass
in interface VariableManagerOwnerBase
public ResourceBundleDef getResourceBundleDef()
getResourceBundleDef
in interface VariableManagerOwnerBase
public void setSavedVariables(java.util.HashMap<java.lang.String,java.lang.Object> savedVariablesMap)
savedVariablesMap
- stores the variable name value pairs that
the user customizes for this view criteria. If the values are not changed
subsequently they are pushed into the variable manager prior to query executepublic java.util.HashMap<java.lang.String,java.lang.Object> getSavedVariables()
public void setSavedValuesInVariableMgr()
public void add(int index, java.lang.Object element)
add
in interface java.util.List
add
in class java.util.Vector
public boolean add(java.lang.Object o)
add
in interface java.util.Collection
add
in interface java.util.List
add
in class java.util.Vector
public boolean addAll(java.util.Collection c)
addAll
in interface java.util.Collection
addAll
in interface java.util.List
addAll
in class java.util.Vector
public boolean addAll(int index, java.util.Collection c)
addAll
in interface java.util.List
addAll
in class java.util.Vector
public void addElement(java.lang.Object obj)
addElement
in class java.util.Vector
public void clear()
clear
in interface java.util.Collection
clear
in interface java.util.List
clear
in class java.util.Vector
public void insertElementAt(java.lang.Object obj, int index)
insertElementAt
in class java.util.Vector
public java.lang.Object remove(int index)
remove
in interface java.util.List
remove
in class java.util.Vector
public boolean remove(java.lang.Object o)
remove
in interface java.util.Collection
remove
in interface java.util.List
remove
in class java.util.Vector
public boolean removeAll(java.util.Collection c)
removeAll
in interface java.util.Collection
removeAll
in interface java.util.List
removeAll
in class java.util.Vector
public void removeAllElements()
removeAllElements
in class java.util.Vector
public boolean removeElement(java.lang.Object obj)
removeElement
in class java.util.Vector
public void removeElementAt(int index)
removeElementAt
in class java.util.Vector
protected void removeRange(int fromIndex, int toIndex)
removeRange
in class java.util.Vector
public boolean retainAll(java.util.Collection c)
retainAll
in interface java.util.Collection
retainAll
in interface java.util.List
retainAll
in class java.util.Vector
public java.lang.Object set(int index, java.lang.Object element)
set
in interface java.util.List
set
in class java.util.Vector
public void setElementAt(java.lang.Object obj, int index)
setElementAt
in class java.util.Vector
public java.lang.String getLocaleName(LocaleContext locale, java.lang.String sName)
locale
- the locale context for the current thread of executionsName
- the name of the property that needs to be resolved
protected void getResourcesFromBundle(LocaleContext locale, java.util.HashMap map)
locale
- locale of the resources to be retrieved.map
- the retrieved resources will be added to the map.public java.lang.Object getProperty(java.lang.String property, LocaleContext locale)
getProperty
in interface Properties
property
- the name of the propertylocale
- the locale context for the current thread of execution
public java.lang.Object getProperty(java.lang.String property)
Properties
getProperty
in interface Properties
property
- the name of the property
public java.lang.Object refreshProperty(java.lang.String hintName)
refreshProperty
in interface Properties
hintName
- the property that needs to be re-resolved from the message bundle
public java.util.Hashtable getLocalAndResourceProperties()
public java.util.Hashtable getProperties()
Properties
getProperties
in interface Properties
getProperties(LocaleContext)
because it will
return a value by looking up the message bundle and for a given localepublic java.util.Hashtable getProperties(LocaleContext context)
context
- the locale context for the current thread of execution
public void setProperty(java.lang.String hintName, java.lang.Object hintValue)
hintName
- name of the propertyhintValue
- value of the property. If the property needs to be
passivated and activated the value needs to be converted to a String by
the caller.public void removeProperty(java.lang.String hintName)
hintName
- the name of the propertypublic void setProperties(java.util.Hashtable properties)
properties
- the view criteria will store a reference to the
hash table passed in the argument and use it for all property lookups.public final java.lang.String getDisplayName(LocaleContext locale)
getProperty(String, LocaleContext)
instead. For the property name
argument pass ViewCriteriaHints.CRITERIA_DISPLAY_NAME
.
locale
-
protected VariableManager getVoVariableManager()
public java.lang.String getCriteriaAlias(ViewCriteria vc)
public void putCriteriaAlias(ViewCriteria vc, java.lang.String vcAlias)
public java.lang.String putDefaultCriteriaAlias(ViewCriteria vc, boolean isNested)
public void setSubQueryAliasEnabled(boolean bEnabled)
public boolean isSubQueryAliasEnabled()
protected java.lang.Object[] convertMapToArray(java.util.HashMap<java.lang.String,java.lang.Object> varsMap)
protected java.util.HashMap<java.lang.String,java.lang.Object> convertArrayToMap(java.lang.Object[] valuesArr)
public void setExtendedDataForVarName(java.lang.String varName, java.lang.Object extendedData)
public java.lang.Object getExtendedDataForVarName(java.lang.String varName)
public void setExtendedDataOffset(int offset, boolean bSkipIfAlreadySet)
public void setKeepExtendedDataOffset(boolean keepExtendedDataOffset)
public int getExtendedDataOffset()
public boolean clausesCacheDisabled()
public void setConjunctionOnChildren(int conjunction)
conjunction
- The conjunction that the child objects should be using.public VariableValueManager getContextualVariableManager()
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Model 11g Release 1 (11.1.1.4.0) E10653-05 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |