Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

oracle.jbo.server
Class ViewDefImpl

java.lang.Object
  extended by oracle.jbo.server.NamedObjectImpl
      extended by oracle.jbo.mom.PersistableDefObject
          extended by oracle.jbo.server.DefObject
              extended by oracle.jbo.server.MetaObject
                  extended by oracle.jbo.server.RowDef
                      extended by oracle.jbo.server.ViewDefImpl
All Implemented Interfaces:
Formattable, ResourceBundleOwner, StructureDef, VariableManagerOwner, VariableManagerOwnerBase, ViewCriteriaResolver

public class ViewDefImpl
extends RowDef
implements StructureDef, ViewCriteriaResolver


Field Summary
static java.lang.Class CLASS_INSTANCE
           
static int CLAUSE_GENERATE_RT
           
 
Fields inherited from class oracle.jbo.server.RowDef
mAttrAccessors
 
Fields inherited from class oracle.jbo.server.MetaObject
mComponentClass
 
Fields inherited from class oracle.jbo.server.DefObject
DEF_MDS_CLIENT_KEY, DEF_SCOPE_PERS, DEF_SCOPE_SESSION, DEF_SCOPE_SHARED, mBaseDefObject, mExtendedDefObjects, mObjectResolved, PERSDEF_MDS_CLIENT_KEY
 
Fields inherited from class oracle.jbo.server.NamedObjectImpl
mObjName, mParent, mProperties, mUserData, RES_ID_SUFFIX
 
Constructor Summary
ViewDefImpl()
           
ViewDefImpl(java.lang.String name)
           
 
Method Summary
 void addAllEntityAttributes(java.lang.String entityUsageName)
           
 AttributeDefImpl addEntityAttribute(java.lang.String attrName, java.lang.String entityUsageName, java.lang.String entityAttrName, boolean isPersistent)
           
 void addEntityUsage(java.lang.String usageName, java.lang.String entityDefName, boolean referenceOnly, boolean readOnly, java.lang.String assocName, java.lang.String assocEndName, java.lang.String srcUsageName)
           
 AttributeDefImpl addViewAttribute(java.lang.String attrName, java.lang.String expression, java.lang.Class javaType)
           
 java.lang.String buildDefaultFrom(AttributeDef[] attrDefs, SQLBuilder builder, BaseViewCriteriaManagerImpl vcManager)
           
 java.lang.String buildDefaultFrom(SQLBuilder builder)
          Generates a "from" clause based on the entity references in this View Definition.
static java.lang.String buildDefaultSelect(AttributeDef[] attrDefs)
           
 AttributeDef findAttrDefByEntAttrDef(AttributeDef entAttrDef)
          Get an attribute definition for an entity attribute definition.
static ViewDefImpl findDefObject(java.lang.String viewDefName)
          Find the named ViewDefImpl object
 StructureDef findStructureDefByName(java.lang.String structDefFullName)
           
 java.lang.String formatForOutput(OutputFormatter formatter)
           
 byte getAccessMode()
          Get the access mode for rows from the query.
 java.lang.String[] getAllViewCriteriaNames()
           
 AttributeDefImpl[] getAltKeyAttrDefs(java.lang.String name)
           
 int getAttributeCount()
          How many attributes comprise this row?
protected  AttributeDefImpl[] getAttributeDefImpls()
          Gets an array of attribute definitions in this View Def.
 java.lang.Class getBaseComponentClass()
           
 int getCalculatedAttributeCount()
           
 java.lang.String getClientProxyClassName()
           
 java.lang.String getColumnNameForQuery(int index)
           
protected  int getColumns()
           
 java.lang.Class getComponentClass()
           
 java.lang.String getComponentInterfaceName()
           
 SortCriteria[] getDBSortCriteria()
           
protected  java.lang.String getEffectiveClientProxyClassName()
           
protected  java.lang.String getEffectiveComponentInterfaceName()
           
 AttributeDefImpl getEffectiveDateTransientAttr()
          Retuns the Attribute definition that stores the Effective Date value in a row.
protected  java.lang.String getEffectiveDateTransientAttrName()
           
 int getEntityIndex(EntityReference entityRef)
           
protected  EntityReference getEntityReference(int index)
           
 EntityReference getEntityReference(java.lang.String name)
           
protected  EntityReference[] getEntityReferences(AttributeDef[] attrDefs)
          Returns an array of EntityReference's upon which this ViewObject is based.
 byte getFetchMode()
          Get the fetch mode for rows from the query.
 short getFetchSize()
          Get the size of the fetch.
 java.lang.String getFromClause()
          Get the FROM clause used in the SQL query
 java.lang.String getFromClause(SQLBuilder builder)
          Returns the from clause associated with this View Definition.
 int getFromClauseFlags()
           
 int getIterMode()
           
 ViewDefImpl getListBindingViewDef()
           
 int getMaxActiveNodes()
           
 int getMaxFetchSize()
           
 int getMaxRowsPerNode()
           
 java.lang.String getOrderByClause()
          Get the ORDER BY clause used in the SQL query
protected  AttributeDefImpl[] getPrimaryKeys()
          Gets an array of AttributeDefImpl's for the primary keys comprising this VO.
 java.lang.String getQuery()
           
 java.lang.String getQueryHint()
           
 int getRangePagingCacheFactor()
          Get the range paging cache factor.
 int getRangeSize()
           
 ViewCriteria getReqdVC()
           
 java.lang.Class getRowClass()
           
protected  int getRows()
           
 java.lang.String getSelectClause()
          Get the SELECT clause used in the SQL query
 int getSelectClauseFlags()
           
protected static java.lang.String getStaticListCellId(java.lang.String voClassPath, int row, int col)
           
 ViewCriteria getViewCriteria(java.lang.String name)
           
 AttributeDefImpl[] getViewKeyAttrDefs(ViewKeyDef viewKeyDef)
           
 java.lang.String getWhereClause()
          Get the WHERE clause used in the SQL query
protected  StmtWithBindVars getWhereClause(AttributeDef[] attrDefs, int noBindVars, SQLBuilder builder)
           
 int getWhereClauseFlags()
           
 java.lang.String getXMLElementTag()
           
protected  boolean hasPrimaryEntity()
           
 boolean hasQuery()
           
 boolean isAutoRefreshEnabled()
           
 boolean isEffectiveDated()
          Tests if the row definition corresponds to an Effective Dated object.
 boolean isFinderView()
           
 boolean isFullSql()
          Is the SQL query custom-defined?
 boolean isManageRowsByKey()
           
 boolean isPassivationEnabled()
           
 boolean isPLSQLView()
          A View Object is PLSQL view if it is defined as PL/SQL view object.
 boolean isQueryThruEntity()
           
 boolean isReadOnly()
           
 boolean isRuntimeSQLGeneration()
           
 boolean isStatic()
          A View Object is static if it is defined as static.
 boolean isViewLinkAccessorRetained()
           
protected static void loadFromXML(org.kxml2.io.KXmlParser parser, oracle.jbo.server.RemotableCompDef defObj)
           
 void loadXMLContents(org.kxml2.io.KXmlParser parser, java.lang.String fullName)
           
 ViewAccessorDef lookupViewAccessorDef(java.lang.String name)
           
 void resolveDefObject()
          Resolves this View Def.
 void setClientProxyClassName(java.lang.String name)
           
 void setComponentClass(java.lang.Class refClass)
           
 void setComponentInterfaceName(java.lang.String interfaceName)
           
 void setEffectiveDated(boolean b)
           
 void setOrderByClause(java.lang.String clause)
          Set the ORDER BY clause to use in the SQL query
 void setRangeSize(int r)
           
 void setReqdVC(ViewCriteria vc)
           
 void setRowClass(java.lang.Class rowClass)
           
 void setupForLov(ViewObjectImpl vo)
           
 void setWhereClause(java.lang.String clause)
          Set the WHERE clause to use in the SQL query
 
Methods inherited from class oracle.jbo.server.RowDef
addAltKey, addListBindingDef, addViewAccessorDef, appendBindingNameForAttr, appendBindingSpec, bindListBindings, createDef, discrValuesQualify, findAltKeyDef, findAttributeDef, findDefForDiscrValues, findListBindingDef, findViewAccessorDef, getAliasName, getAltKeyAttrDefs, getAltKeyCount, getAltKeyDef, getAltKeyNames, getAttributeDef, getAttributeDefImpl, getAttributeDefImpl, getAttributeDefs, getAttributeIndexOf, getBindingStyle, getDefFullName, getDefName, getDiscrColumns, getListBindingDefs, getViewAccessorDefs, loadListBindings, loadViewAccessor, lookupAltKeyDef, lookupAttributeDef, lookupListBindingDef, setAliasName, setBindingStyle, setDiscrColumns, setThrowOnListBindingMismatch, throwOnListBindingMismatch
 
Methods inherited from class oracle.jbo.server.MetaObject
getMessageBundleClass, getMsgBundleDef, setMessageBundleClass
 
Methods inherited from class oracle.jbo.server.DefObject
addExtendedDefObject, ensureVariableManager, getBaseDefObject, getDefScope, getExtendedDefObjects, getResourceBundleDef, getResourcePrefix, getVariableManager, getVarMgrParents, hasExtendedDefObjects, hasVariables, isBaseDefFor, isObjectResolved, loadProperties, loadProperties, loadResourceBundleDef, loadUserData, resolvePropertyRaw, setBaseDefObject, setBaseDefObject, setDefForComponent, setDefScope, setObjectResolved, setResourceBundleDef, unsetDefForComponent
 
Methods inherited from class oracle.jbo.mom.PersistableDefObject
getDefManager
 
Methods inherited from class oracle.jbo.server.NamedObjectImpl
formatChildCollectionForOutput, formatChildCollectionForOutput, formatChildCollectionForOutput, formatForOutput, getAllProperties, getFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getResourcesFromBundle, getUserData, parseAttrArrayElements, refreshProperty, requiresNamePrefixedResId, setFullName, setName, setParent, setPropertiesMap, setProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jbo.StructureDef
findAttributeDef, getAttributeDef, getAttributeDefs, getAttributeIndexOf, getDefFullName, getDefName, getFullName, getName, lookupAttributeDef
 
Methods inherited from interface oracle.jbo.common.ResourceBundleOwner
getResourceBundleDef, getResourcePrefix
 
Methods inherited from interface oracle.jbo.VariableManagerOwner
getName
 

Field Detail

CLASS_INSTANCE

public static final java.lang.Class CLASS_INSTANCE

CLAUSE_GENERATE_RT

public static final int CLAUSE_GENERATE_RT
See Also:
Constant Field Values
Constructor Detail

ViewDefImpl

public ViewDefImpl()

ViewDefImpl

public ViewDefImpl(java.lang.String name)
Method Detail

getQuery

public java.lang.String getQuery()

getOrderByClause

public java.lang.String getOrderByClause()
Get the ORDER BY clause used in the SQL query

Returns:
ORDER BY clause, or null if one is not defined

setOrderByClause

public void setOrderByClause(java.lang.String clause)
Set the ORDER BY clause to use in the SQL query

Parameters:
clause - New ORDER BY clause

getWhereClause

public java.lang.String getWhereClause()
Get the WHERE clause used in the SQL query

Returns:
WHERE clause, or null if one is not defined

setWhereClause

public void setWhereClause(java.lang.String clause)
Set the WHERE clause to use in the SQL query

Parameters:
clause - New WHERE clause

getFromClause

public java.lang.String getFromClause()
Get the FROM clause used in the SQL query

Returns:
FROM clause, or null if one is not defined

getSelectClause

public java.lang.String getSelectClause()
Get the SELECT clause used in the SQL query

Returns:
SELECT clause, or null if one is not defined

isFullSql

public boolean isFullSql()
Is the SQL query custom-defined?

Returns:
true if custom-defined; false if pieced together from WHERE, FROM, etc.

getEntityReference

protected EntityReference getEntityReference(int index)

getEntityReference

public EntityReference getEntityReference(java.lang.String name)

getPrimaryKeys

protected AttributeDefImpl[] getPrimaryKeys()
Gets an array of AttributeDefImpl's for the primary keys comprising this VO.

Specified by:
getPrimaryKeys in class RowDef
Returns:
An array of AttributeDefImpl's. This will be 0-length if there are no primary keys defined

findDefObject

public static final ViewDefImpl findDefObject(java.lang.String viewDefName)
Find the named ViewDefImpl object

Parameters:
viewDefName - Name of object
Returns:
A matching ViewDefImpl, or null if not found

isReadOnly

public boolean isReadOnly()

isEffectiveDated

public boolean isEffectiveDated()
Description copied from class: RowDef
Tests if the row definition corresponds to an Effective Dated object.

Overrides:
isEffectiveDated in class RowDef

getFromClause

public java.lang.String getFromClause(SQLBuilder builder)
Returns the from clause associated with this View Definition. If the clause is configured to be generated at runtime, it is constructed based on the entity references. See #setFromClauseFlags(int).

Parameters:
builder - The SQLBuilder abstracts the actual database specific syntax generation.
Returns:
The "from" clause

buildDefaultFrom

public java.lang.String buildDefaultFrom(SQLBuilder builder)
Generates a "from" clause based on the entity references in this View Definition.

Parameters:
builder - The SQLBuilder abstracts the actual database specific syntax generation.
Returns:
The "from" clause

getEffectiveDateTransientAttr

public AttributeDefImpl getEffectiveDateTransientAttr()
Description copied from class: RowDef
Retuns the Attribute definition that stores the Effective Date value in a row. This method is overridden in ViewDefImpl and EntityDefImpl.

Overrides:
getEffectiveDateTransientAttr in class RowDef

getEffectiveDateTransientAttrName

protected java.lang.String getEffectiveDateTransientAttrName()

getEntityReferences

protected EntityReference[] getEntityReferences(AttributeDef[] attrDefs)
Returns an array of EntityReference's upon which this ViewObject is based. Each EntityReference refers to EntityDef that describes the Entity. Only return the EntityDef's that are not hidden

Returns:
the EntityReference array.

buildDefaultFrom

public java.lang.String buildDefaultFrom(AttributeDef[] attrDefs,
                                         SQLBuilder builder,
                                         BaseViewCriteriaManagerImpl vcManager)

getAllViewCriteriaNames

public java.lang.String[] getAllViewCriteriaNames()
Returns:
a list with all criteria names available in this definition

getViewCriteria

public ViewCriteria getViewCriteria(java.lang.String name)

resolveDefObject

public void resolveDefObject()
Resolves this View Def. It resolves attribute definitions with its entity bases.

This method must be called after the View Def is set up and before registerDefObject().


isRuntimeSQLGeneration

public boolean isRuntimeSQLGeneration()

findStructureDefByName

public StructureDef findStructureDefByName(java.lang.String structDefFullName)
Specified by:
findStructureDefByName in interface ViewCriteriaResolver

getColumnNameForQuery

public java.lang.String getColumnNameForQuery(int index)
Specified by:
getColumnNameForQuery in interface StructureDef
Overrides:
getColumnNameForQuery in class RowDef

setEffectiveDated

public void setEffectiveDated(boolean b)

addViewAttribute

public AttributeDefImpl addViewAttribute(java.lang.String attrName,
                                         java.lang.String expression,
                                         java.lang.Class javaType)

getCalculatedAttributeCount

public int getCalculatedAttributeCount()
Returns:
Count of calculated attributes

findAttrDefByEntAttrDef

public AttributeDef findAttrDefByEntAttrDef(AttributeDef entAttrDef)
Get an attribute definition for an entity attribute definition.

Parameters:
entAttrDef - entity attribute def
Returns:
the view attribute which is mapped to the entity attr. null if not found.

hasPrimaryEntity

protected boolean hasPrimaryEntity()
Returns:
true if the View Object has primary Entity base.

getAttributeDefImpls

protected AttributeDefImpl[] getAttributeDefImpls()
Gets an array of attribute definitions in this View Def.

Overrides:
getAttributeDefImpls in class RowDef
Returns:
an array of attribute definitions.

buildDefaultSelect

public static java.lang.String buildDefaultSelect(AttributeDef[] attrDefs)

getWhereClause

protected StmtWithBindVars getWhereClause(AttributeDef[] attrDefs,
                                          int noBindVars,
                                          SQLBuilder builder)
Returns:
The WHERE clause

isFinderView

public boolean isFinderView()

getDBSortCriteria

public SortCriteria[] getDBSortCriteria()

isViewLinkAccessorRetained

public boolean isViewLinkAccessorRetained()

getEntityIndex

public int getEntityIndex(EntityReference entityRef)
Returns:
The index of an EntityReference in this object.

getRowClass

public java.lang.Class getRowClass()
Specified by:
getRowClass in class RowDef
Returns:
The Class of the instance.

getAccessMode

public byte getAccessMode()
Get the access mode for rows from the query. The value returned will be: RowSet.SCROLLABLE, RowSet.FORWARD_ONLY, RowSet.RANGE_PAGING, RowSet.RANGE_PAGING_AUTO_POST, or RowSet.RANGE_PAGING_INCR.

Returns:
RowSet.SCROLLABLE, RowSet.FORWARD_ONLY, RowSet.RANGE_PAGING, RowSet.RANGE_PAGING_AUTO_POST, or RowSet.RANGE_PAGING_INCR.

getRangePagingCacheFactor

public int getRangePagingCacheFactor()
Get the range paging cache factor.

Returns:
the range paging cache factor.

addEntityUsage

public void addEntityUsage(java.lang.String usageName,
                           java.lang.String entityDefName,
                           boolean referenceOnly,
                           boolean readOnly,
                           java.lang.String assocName,
                           java.lang.String assocEndName,
                           java.lang.String srcUsageName)

addAllEntityAttributes

public void addAllEntityAttributes(java.lang.String entityUsageName)

addEntityAttribute

public AttributeDefImpl addEntityAttribute(java.lang.String attrName,
                                           java.lang.String entityUsageName,
                                           java.lang.String entityAttrName,
                                           boolean isPersistent)

getBaseComponentClass

public java.lang.Class getBaseComponentClass()
Overrides:
getBaseComponentClass in class RowDef

formatForOutput

public java.lang.String formatForOutput(OutputFormatter formatter)
Specified by:
formatForOutput in interface Formattable
Overrides:
formatForOutput in class RowDef

getFromClauseFlags

public int getFromClauseFlags()

getSelectClauseFlags

public int getSelectClauseFlags()

getWhereClauseFlags

public int getWhereClauseFlags()

getFetchMode

public byte getFetchMode()
Get the fetch mode for rows from the query. The value returned will be FETCH_AS_NEEDED or FETCH_ALL.

Returns:
FETCH_AS_NEEDED or FETCH_ALL.

getFetchSize

public short getFetchSize()
Get the size of the fetch.

Returns:
the size, in rows, of the chunk to fetch.

getMaxFetchSize

public int getMaxFetchSize()

getQueryHint

public java.lang.String getQueryHint()

isManageRowsByKey

public boolean isManageRowsByKey()

isPassivationEnabled

public final boolean isPassivationEnabled()

isQueryThruEntity

public boolean isQueryThruEntity()

getAttributeCount

public int getAttributeCount()
Description copied from class: RowDef
How many attributes comprise this row?

Specified by:
getAttributeCount in interface StructureDef
Overrides:
getAttributeCount in class RowDef
Returns:
The number of attributes.

hasQuery

public boolean hasQuery()

isStatic

public boolean isStatic()
A View Object is static if it is defined as static. A static view object has a static list used as data source to populate the view object.

Returns:
True if view is static.

getRows

protected int getRows()

getColumns

protected int getColumns()

getStaticListCellId

protected static java.lang.String getStaticListCellId(java.lang.String voClassPath,
                                                      int row,
                                                      int col)

isPLSQLView

public boolean isPLSQLView()
A View Object is PLSQL view if it is defined as PL/SQL view object. A PLSQL view object is populated by calling PL/SQL stored procedure or function.

Returns:
True if the view is PLSQL view object.

isAutoRefreshEnabled

public boolean isAutoRefreshEnabled()

getMaxRowsPerNode

public int getMaxRowsPerNode()

getMaxActiveNodes

public int getMaxActiveNodes()

getRangeSize

public int getRangeSize()

setRangeSize

public void setRangeSize(int r)

getXMLElementTag

public java.lang.String getXMLElementTag()

lookupViewAccessorDef

public ViewAccessorDef lookupViewAccessorDef(java.lang.String name)
Overrides:
lookupViewAccessorDef in class RowDef

getListBindingViewDef

public ViewDefImpl getListBindingViewDef()

setupForLov

public void setupForLov(ViewObjectImpl vo)

getReqdVC

public ViewCriteria getReqdVC()

setReqdVC

public void setReqdVC(ViewCriteria vc)

getAltKeyAttrDefs

public AttributeDefImpl[] getAltKeyAttrDefs(java.lang.String name)
Overrides:
getAltKeyAttrDefs in class RowDef

getIterMode

public int getIterMode()

getViewKeyAttrDefs

public AttributeDefImpl[] getViewKeyAttrDefs(ViewKeyDef viewKeyDef)

setRowClass

public void setRowClass(java.lang.Class rowClass)
Parameters:
rowClass - The Class of the instance.

getComponentClass

public java.lang.Class getComponentClass()

setComponentClass

public void setComponentClass(java.lang.Class refClass)
Overrides:
setComponentClass in class MetaObject

setComponentInterfaceName

public void setComponentInterfaceName(java.lang.String interfaceName)

getComponentInterfaceName

public java.lang.String getComponentInterfaceName()

getClientProxyClassName

public java.lang.String getClientProxyClassName()

setClientProxyClassName

public void setClientProxyClassName(java.lang.String name)

getEffectiveClientProxyClassName

protected java.lang.String getEffectiveClientProxyClassName()

getEffectiveComponentInterfaceName

protected java.lang.String getEffectiveComponentInterfaceName()

loadFromXML

protected static void loadFromXML(org.kxml2.io.KXmlParser parser,
                                  oracle.jbo.server.RemotableCompDef defObj)

loadXMLContents

public void loadXMLContents(org.kxml2.io.KXmlParser parser,
                            java.lang.String fullName)
Overrides:
loadXMLContents in class PersistableDefObject

Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client
11g Release 1 (11.1.1)

E17503-02

Copyright © 2011, Oracle and/or its affiliates. All rights reserved.