|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-02 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ViewObject
decribes how the application will view and update data. A View Object may be Entity based or non-Entity based. In the former case, the View Object consists of one or more Entity bases. The first one of these is referred to as the primary Entity base. The rest are called secondary Entity bases. An Entity based View Object maps its attribute (View Attributes) to attributes in the Entities (Entity Attributes). An Entity based View Object may map all its Entity Attributes or only some of them. However, an Entity based View Object is required to map all primary key attributes of the Entity bases. An Entity based View Object may additional include attributes that are not mapped to an Entity Attribute. Such an attribute is referred to View level attribute.
A non-Entity based View Object is one where it does not have any Entity base. All its attributes are View level attributes.
View Object is responsible for managing database query statement. Regardless of whether the View Object is Entity based or not, it may have a SQL statement from which it draws its data. As rows are read from this query, it will populate a
(of this View Object) with View rows.RowSet
View Object provides a number of APIs through which the client can modify and augment the query statement during runtime. For example, see
.ViewObject#setWhereClause()
A View level attribute (not mapped to an Entity attribute) may map to a column or a SQL expression in the query statement. It may be a transient attribute (whose data is purely in memory and not mapped to any database column/expression. Or, it may be a dynamic attribute.
Row
, RowSet
, RowSetIterator
, StructureInfo
, AttributeDef
Field Summary |
Fields inherited from interface oracle.jbo.RowSet |
FORWARD_ONLY, RANGE_PAGING, RANGE_PAGING_AUTO_POST, SCROLLABLE |
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.XMLInterface |
XML_IGNORE_DEPTH_COUNT, XML_OPT_ALL_ROWS, XML_OPT_ASSOC_CONSISTENT, XML_OPT_CHANGES_ONLY, XML_OPT_LIMIT_RANGE |
Method Summary | |
AttributeDef |
addDynamicAttribute(java.lang.String attrName) Adds a dynamic attribute (an AttributeDefImpl) to this View Object's row set. |
void |
applyViewCriteria(ViewCriteria criteria) Applies the view criteria to this View Object. |
void |
clearCache() Clears the View Object cache. |
RowSet |
createRowSet(java.lang.String name) Creates and returns a new (secondary) Row Ret for this View Object. |
ViewCriteria |
createViewCriteria() Creates a new view criteria (that is, "Query by Example") object for this View Object. |
RowSet |
findRowSet(java.lang.String rsName) Gets the named Row Set that was created at runtime for this View Object. |
AttributeDef |
findViewLinkAccessor(ViewLink vl) Finds the view link accessor attribute. |
AttributeDef[] |
getAttrDefsForEntityAttr(java.lang.String eoName, java.lang.String eoAttrName) Returns the definitions of view attributes that are mapped to the entity attribute identified by the entity name (the eoName parameter) and the entity attribute name (the eoAttrName ). |
AttributeDef[] |
getKeyAttributeDefs() Returns the attribute definitions that make up the constituents of the Key object for Rows returned from this View Object. |
int |
getMaxFetchSize() Maximum number of rows to fetch for this View Object. |
java.lang.String |
getOrderByClause() Returns the query's ORDER BY clause. |
java.lang.String |
getQuery() Returns the query statement. |
java.lang.String |
getQueryOptimizerHint() Returns Query Optimizer Hint set for this ViewObject or for its definition object. |
RowSet[] |
getRowSets() Gets all Row Sets that belong to this View Object. |
ViewCriteria |
getViewCriteria() Gets the view criteria for this View Object. |
java.lang.String[] |
getViewLinkNames() Constructs an array of names of View Links that involve this View Object. |
java.lang.String |
getWhereClause() Gets the query's WHERE clause. |
boolean |
isInternal() Returns whether this View Object was created internally by BC4J or by an explicit user request. |
boolean |
isReadOnly() Tests if the View Object is read-only. |
void |
readRowXML(Element elem, int depthCount) Reads the data in XML form (in the format as generated by writeXML()) by finding a row that matches the key in the given XML and then reading in that row. |
void |
readRowXML(Element elem, int depthCount, XSLStylesheet xslt) |
void |
setMaxFetchSize(int max) Maximum number of rows to fetch for this View Object. |
void |
setOrderByClause(java.lang.String expr) Sets the ORDER BY clause of the View Object's query statement. |
void |
setQueryOptimizerHint(java.lang.String hintText) If this ViewObject does not have an expert mode query, then this hint is added to the select clause of the SQL for this ViewObject before the columns are listed e.g., SELECT \/*+ <hintText> *\/ columns... |
void |
setWhereClause(java.lang.String cond) Sets a WHERE clause bind value of the View Object's query statement. |
Methods inherited from interface oracle.jbo.StructureDef |
findAttributeDef, getAttributeCount, getAttributeDef, getAttributeDefs, getAttributeIndexOf, getDefFullName, getDefName, getFullName, getName, lookupAttributeDef |
Methods inherited from interface oracle.jbo.RowSetIterator |
addManagementListener, closeRowSetIterator, createDetailRowSet, getDetailRowSets, getEstimatedRangePageCount, getFilteredRows, getFilteredRowsInRange, getNextRangeSet, getPreviousRangeSet, getRowSet, getSyncLock, isNameGenerated, removeManagementListener, scrollToRangePage |
Methods inherited from interface oracle.jbo.NavigatableRowIterator |
addListener, removeListener |
Methods inherited from interface oracle.jbo.Properties |
getProperties, getProperty, refreshProperty |
Methods inherited from interface oracle.jbo.XMLInterface |
readXML, readXML, writeXML, writeXML, writeXML, writeXML |
Methods inherited from interface oracle.jbo.ComponentObject |
getDefFullName, getDefName, getFullName, getName, remove |
Method Detail |
public AttributeDef addDynamicAttribute(java.lang.String attrName)
Dynamic attributes are typeless, in that the application can set the attribute value to any object. You can use a dynamic attribute to store information created at runtime that you want to store with the row data. It is used only by the View Object that created it. Attributes can be any Serializable object.
This method should not be overridden.
attrName
- the name of the dynamic attribute.NameClashException
- if an attribute of the same name already exists.public void setWhereClause(java.lang.String cond)
Bind variables can be specified using '?' as a place-holder for the value.
The new WHERE clause does not take effect until ViewObjectImpl.executeQuery()
is called. For an example usage of this method, see ViewObjectImpl.setWhereClauseParam(int, Object)
.
Note that calling setWhereClause() does not clear the previous settings of WHERE clause parameters. To reset WHERE clause parameters in the middle tier, call ViewObjectImpl.setWhereClauseParams(Object[])
explicitly with a null value. For example:
vo.setWhereClauseParams(null);This method should not be overridden.
cond
- a WHERE clause, but excluding the 'WHERE' keyword.public java.lang.String getWhereClause()
This WHERE clause is obtained from the View Object instance. In the middle tier, to get the WHERE clauses built from the View Object instance, the View definition, and the detail View Objects, use ViewObjectImpl.buildWhereClause(java.lang.StringBuffer, int)
public void setOrderByClause(java.lang.String expr)
ViewObjectImpl.executeQuery()
is called.
This method should not be overridden.
public java.lang.String getOrderByClause()
This method should not be overridden.
public java.lang.String getQuery()
ViewObjectImpl.getUserDefinedQuery()
this method will return a SQL statement regardless of whether the query was created in Expert or non-Expert Mode.public boolean isReadOnly()
A view is read-only if it does not have Primary Keys or if all its entity references are reference-only.
This method should not be overridden.
true
if this View Object is read-only; false if it is updateable.public RowSet createRowSet(java.lang.String name)
name
- the name for the new RowSet
.public RowSet[] getRowSets()
public RowSet findRowSet(java.lang.String rsName)
rsName
- a Row Set name. If null
, it returns the the View Object.null
if the named Row Set is not not found.public java.lang.String[] getViewLinkNames()
A View Link may use this View Object as either its source or destination. This method should not be overridden.
public ViewCriteria createViewCriteria()
A view criteria is a more structured way of creating a SQL query WHERE clause. After setting various conditions for the view criteria object, the application can call applyViewCriteria
This method should not be overridden.
ViewCriteria
, applyViewCriteria(ViewCriteria)
public void applyViewCriteria(ViewCriteria criteria)
View criteria rows are ORed together, while entries in the same row are ANDed together.
This method should not be overridden.
criteria
- a view criteria object.public ViewCriteria getViewCriteria()
This method should not be overridden.
null
if none is specified.public AttributeDef findViewLinkAccessor(ViewLink vl)
vl
- the view link whose accessor is being sought.null
if not.public AttributeDef[] getKeyAttributeDefs()
This method is used to pass AttributeDef[] to the Key.Key(String, AttributeDef[])
constructor to parse the constituent-bytes and convert them into value-objects that make up the Key.
Use this method to find out how the key is composed for the View row. The View Object's key is a composite key, consisting of view attributes mapped to the primary keys of its Entity Objects.
public AttributeDef[] getAttrDefsForEntityAttr(java.lang.String eoName, java.lang.String eoAttrName)
eoName
parameter) and the entity attribute name (the eoAttrName
).
Note that it returns an array because more than one View Object attribute may be mapped to one entity attribute.
This method can be used to identify view attributes that map into a particular entity object attribute. In particular, if a validation error fails on an entity attribute, this method can be used to find view attributes that map into that entity attribute.
eoName
- fully qualified name of the entity object.eoAttrName
- entity object attribute name.public void clearCache()
public int getMaxFetchSize()
public void setMaxFetchSize(int max)
Passing -1 to this method will retrieve an unlimited number of rows. This is the default.
Passing 0 to this method will cause the database query not to be executed. The View Object will initially work with an empty row set. If you want to execute query later, call setMaxFetchSize again with a non-zero argument, then call executeQuery().
public void setQueryOptimizerHint(java.lang.String hintText)
public java.lang.String getQueryOptimizerHint()
public boolean isInternal()
public void readRowXML(Element elem, int depthCount)
The depthcount parameter represents to what level the rendering should recurse. A depthcount of zero (0) means do not traverse any View Links while rendering. One (1) means traverse the View Links on this object but no View Links thereafter, and so on.
public void readRowXML(Element elem, int depthCount, XSLStylesheet xslt)
|
Oracle ADF Model and Business Components API Reference 10.1.2 B14022-02 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2005, Oracle. All rights reserved.