Business Components

oracle.jbo.server
Class ViewDefImpl

java.lang.Object
  |
  +--oracle.jbo.common.NamedObjectImpl
        |
        +--oracle.jbo.mom.DefinitionObject
              |
              +--oracle.jbo.server.DefObject
                    |
                    +--oracle.jbo.server.RowDef
                          |
                          +--oracle.jbo.server.ViewDefImpl
All Implemented Interfaces:
StructureDef
Direct Known Subclasses:
EJBEntityDefImpl

public class ViewDefImpl
extends oracle.jbo.server.RowDef
implements StructureDef

The ViewDefImpl is the base class for all generated ViewDefImpl classes.

Version:
PRIVATE

Field Summary
TypeField
protected  java.lang.Class mComponentClass
           
 
Fields inherited from class oracle.jbo.mom.DefinitionObject
mBaseDefObject, mExtendedDefObjects, mObjectResolved
 
Fields inherited from class oracle.jbo.common.NamedObjectImpl
mFullName, mObjName, mParent, mProperties
 
Constructor Summary
ViewDefImpl(java.lang.String name)
           
 
Method Summary
TypeMethod
 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)
           
 void addEntityUsage(java.lang.String usageName, java.lang.String entityDefName, boolean referenceOnly, 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)
           
protected  boolean discrValuesQualify(java.lang.Object[] values)
           
 AttributeDef findAttributeDef(java.lang.String attrName)
          Get an ViewAttributeDefImpl by name.
protected  oracle.jbo.server.RowDef findDefForDiscrValues(java.lang.Object[] values, boolean recurse)
           
protected  void finishedLoading()
           
 java.lang.String getAliasName()
          Returns the database alias that was declared for this definition object at Design-Time.
 int getAttributeCount()
          Returns the number of defined attributes.
 AttributeDef getAttributeDef(int index)
          Gets an attribute definition, given its index.
protected  AttributeDefImpl[] getAttributeDefImpls()
           
 AttributeDef[] getAttributeDefs()
          Gets the defined attributes.
 oracle.jbo.mom.DefinitionObject getBaseDefObject()
           
 int getBindingStyle()
          Returns the Oracle or JDBC binding style defined for this Entity definition.
 int getCalculatedAttributeCount()
           
 java.lang.Class getComponentClass()
           
protected  AttributeDefImpl[] getDiscrColumns()
          Returns the AttributeDef's of the discriminator columns.
 byte getFetchMode()
          Get the fetch mode for rows from the query.
 short getFetchSize()
          Get the size of the fetch.
 int getMaxActiveNodes()
           
static int getMaxAttrConst(java.lang.String viewDefName)
           
 int getMaxFetchSize()
           
 int getMaxRowsPerNode()
           
 oracle.jbo.server.PackageDefImpl getPackageDef()
           
 java.lang.String getPackageName()
           
 java.lang.String getQueryHint()
           
 java.lang.Class getRowClass()
           
 boolean hasQuery()
           
protected  boolean isDynamic()
           
 boolean isFullSql()
           
 boolean isUseGlueCode()
           
protected  void loadCustomDef(oracle.jbo.mom.xml.DefElementImpl xmlElement)
           
protected  void loadProperties(oracle.jbo.mom.xml.DefElementImpl xmlElement)
           
 AttributeDef lookupAttributeDef(java.lang.String attrName)
          Gets an attribute definition by name.
 void registerDefObject()
           
 void resolveDefObject()
           
protected  void resolveReferences()
          Since this gets called from lazyload
protected  void setBaseDefObject(oracle.jbo.mom.DefinitionObject baseDefObject)
           
 void setBindingStyle(int bindingStyle)
          Sets the Oracle or JDBC binding style defined for this Entity definition.
 void setComponentClass(java.lang.Class componentClass)
           
protected  void setDiscrColumns(AttributeDefImpl[] discrCols)
          Sets the AttributeDef's of the discriminator columns.
 void setFetchMode(byte fetchMode)
          Set the fetch mode for rows from the query.
 void setFetchSize(short size)
          Set the size of the fetch.
 void setFromClause(java.lang.String fromClause)
           
 void setFullSql(boolean b)
           
 void setMaxActiveNodes(int maxActiveNodes)
           
 void setMaxFetchSize(int size)
          Set the maximum number of rows to fetch during query processing.
 void setMaxRowsPerNode(int maxRowsPerNode)
           
protected  void setName(java.lang.String name)
          Name this object.
 void setOrderByClause(java.lang.String orderByClause)
           
protected  void setParent(NamedObjectImpl parent)
          Sets this object's parent.
 void setQuery(java.lang.String query)
           
 void setQueryHint(java.lang.String queryHint)
           
 void setRowClass(java.lang.Class rowClass)
           
 void setSelectClause(java.lang.String selectClause)
           
 void setUseGlueCode(boolean b)
           
 void setWhereClause(java.lang.String whereClause)
           
 
Methods inherited from class oracle.jbo.mom.DefinitionObject
addExtendedDefObject, getContainerDef, getContainerName, getExtendedDefObjects, isBaseDefFor, isDynamicDefinitionObject, isObjectResolved, setObjectResolved
 
Methods inherited from class oracle.jbo.common.NamedObjectImpl
getFullName, getName, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, refreshProperty, setFullName, setPropertiesMap, setProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mComponentClass

protected java.lang.Class mComponentClass
Constructor Detail

ViewDefImpl

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

registerDefObject

public void registerDefObject()

getMaxAttrConst

public static int getMaxAttrConst(java.lang.String viewDefName)

getAttributeDefImpls

protected AttributeDefImpl[] getAttributeDefImpls()
Overrides:
getAttributeDefImpls in class oracle.jbo.server.RowDef
Returns:
The attribute descriptor references defined.

getAttributeDefs

public AttributeDef[] getAttributeDefs()
Description copied from interface: StructureDef
Gets the defined attributes.
Specified by:
getAttributeDefs in interface StructureDef
Following copied from interface: oracle.jbo.StructureDef
Returns:
an array of attribute definitions.

findAttributeDef

public AttributeDef findAttributeDef(java.lang.String attrName)
Get an ViewAttributeDefImpl by name.
Specified by:
findAttributeDef in interface StructureDef
Returns:
The ViewAttributeDefImpl for an attribute or association accessor.

lookupAttributeDef

public AttributeDef lookupAttributeDef(java.lang.String attrName)
Gets an attribute definition by name.
Specified by:
lookupAttributeDef in interface StructureDef
Parameters:
name - the name of an AttributeDef.
Returns:
an attribute definition, or null if not found.

setQuery

public void setQuery(java.lang.String query)
Parameters:
The - sql statement of the query.

setQueryHint

public void setQueryHint(java.lang.String queryHint)

getQueryHint

public java.lang.String getQueryHint()

getCalculatedAttributeCount

public int getCalculatedAttributeCount()
Returns:
Count of calculated attributes

getAttributeCount

public int getAttributeCount()
Description copied from interface: StructureDef
Returns the number of defined attributes.
Specified by:
getAttributeCount in interface StructureDef
Returns:
The number of attributes.

getAttributeDef

public AttributeDef getAttributeDef(int index)
Description copied from interface: StructureDef
Gets an attribute definition, given its index.
Specified by:
getAttributeDef in interface StructureDef
Following copied from interface: oracle.jbo.StructureDef
Parameters:
index - the index of an AttributeDef, where the leftmost attribute has index zero.
Returns:
an attribute definition.

setRowClass

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

getRowClass

public java.lang.Class getRowClass()
Overrides:
getRowClass in class oracle.jbo.server.RowDef
Returns:
The Class of the instance.

setComponentClass

public void setComponentClass(java.lang.Class componentClass)
Parameters:
componentClass - The Class of the instance.

getComponentClass

public java.lang.Class getComponentClass()
Returns:
the Class of the reference object.

setSelectClause

public void setSelectClause(java.lang.String selectClause)
Parameters:
selectClause - The SELECT list

setFromClause

public void setFromClause(java.lang.String fromClause)
Parameters:
fromClause - The FROM clause

setWhereClause

public void setWhereClause(java.lang.String whereClause)
Parameters:
whereClause - The WHERE clause

setOrderByClause

public void setOrderByClause(java.lang.String orderByClause)
Parameters:
orderByClause - The ORDER BY clause

setFetchMode

public void setFetchMode(byte fetchMode)
Set the fetch mode for rows from the query. The valid modes are FETCH_AS_NEEDED an FETCH_ALL, or FETCH_DEFAULT. FETCH_AS_NEEDED will only fetch the number of rows requested whilst FETCH_ALL will pull all of the rows from the database and close out the cursor. Currently FETCH_DEFAULT is equivalent to FETCH_AS_NEEDED. At some point this may be changed to default to some system-level default.
Parameters:
fetchMode - is FETCH_AS_NEEDED, FETCH_ALL or FETCH_DEFAULT.

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.

setFetchSize

public void setFetchSize(short size)
Set the size of the fetch. ViewRowSets of the query are returned in chunks. This method permits the setting of the size of these chunks.
Parameters:
size - the size, in rows, of the chunk to fetch.

getFetchSize

public short getFetchSize()
Get the size of the fetch.
Returns:
the size, in rows, of the chunk to fetch.

setMaxFetchSize

public void setMaxFetchSize(int size)
Set the maximum number of rows to fetch during query processing. When the maximum number of rows has been fetched, the query is closed and no more rows are returned. Setting a value of 0 means that there is no maximum to the number of rows fetched.
Parameters:
size - the number of rows.

getMaxFetchSize

public int getMaxFetchSize()

isUseGlueCode

public boolean isUseGlueCode()

setUseGlueCode

public void setUseGlueCode(boolean b)

setMaxRowsPerNode

public void setMaxRowsPerNode(int maxRowsPerNode)

getMaxRowsPerNode

public int getMaxRowsPerNode()

setMaxActiveNodes

public void setMaxActiveNodes(int maxActiveNodes)

getMaxActiveNodes

public int getMaxActiveNodes()

finishedLoading

protected void finishedLoading()
Overrides:
finishedLoading in class oracle.jbo.server.DefObject

resolveReferences

protected void resolveReferences()
Since this gets called from lazyload
Overrides:
resolveReferences in class oracle.jbo.server.DefObject

resolveDefObject

public void resolveDefObject()

addEntityAttribute

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

addViewAttribute

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

addEntityUsage

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

addEntityUsage

public void addEntityUsage(java.lang.String usageName,
                           java.lang.String entityDefName,
                           boolean referenceOnly)

isFullSql

public boolean isFullSql()

setFullSql

public void setFullSql(boolean b)

isDynamic

protected boolean isDynamic()

loadCustomDef

protected void loadCustomDef(oracle.jbo.mom.xml.DefElementImpl xmlElement)
                      throws PersistenceException

hasQuery

public boolean hasQuery()

getDiscrColumns

protected AttributeDefImpl[] getDiscrColumns()
Returns the AttributeDef's of the discriminator columns.
Returns:
an array attribute definitions of the discriminator columns.

setDiscrColumns

protected void setDiscrColumns(AttributeDefImpl[] discrCols)
Sets the AttributeDef's of the discriminator columns.
Parameters:
discrCols - an array attribute definitions of the discriminator columns.

discrValuesQualify

protected boolean discrValuesQualify(java.lang.Object[] values)

findDefForDiscrValues

protected oracle.jbo.server.RowDef findDefForDiscrValues(java.lang.Object[] values,
                                                         boolean recurse)

getBindingStyle

public int getBindingStyle()
Returns the Oracle or JDBC binding style defined for this Entity definition. The integer values and their meaning are determined by the SQLBuilder interface.
Returns:
an integer representing the Oracle or JDBC binding style. The returns values can be:
  • -1 - unknown
  • 0 - JDBC
  • 1 - Oracle
See Also:
SQLBuilder

setBindingStyle

public void setBindingStyle(int bindingStyle)
Sets the Oracle or JDBC binding style defined for this Entity definition. The integer values and their meaning are determined by the SQLBuilder interface.
Parameters:
bindingStyle - an integer representing the Oracle or JDBC binding style for this Entity definition. The possible values can be:
  • -1 unknown
  • 0 JDBC
  • 1 Oracle
See Also:
SQLBuilder

getAliasName

public java.lang.String getAliasName()
Returns the database alias that was declared for this definition object at Design-Time.
Returns:
the alias for this definition object as a String.

getPackageDef

public oracle.jbo.server.PackageDefImpl getPackageDef()

getPackageName

public java.lang.String getPackageName()

setName

protected void setName(java.lang.String name)
Name this object.
Overrides:
setName in class oracle.jbo.mom.DefinitionObject
Parameters:
name - the name to be given to this object.

getBaseDefObject

public oracle.jbo.mom.DefinitionObject getBaseDefObject()
Overrides:
getBaseDefObject in class oracle.jbo.mom.DefinitionObject

setBaseDefObject

protected void setBaseDefObject(oracle.jbo.mom.DefinitionObject baseDefObject)
Overrides:
setBaseDefObject in class oracle.jbo.mom.DefinitionObject

setParent

protected void setParent(NamedObjectImpl parent)
Sets this object's parent.
Overrides:
setParent in class oracle.jbo.mom.DefinitionObject
Parameters:
parent - the named object that is to be the parent of this object.

loadProperties

protected void loadProperties(oracle.jbo.mom.xml.DefElementImpl xmlElement)
Overrides:
loadProperties in class oracle.jbo.mom.DefinitionObject
Following copied from class: oracle.jbo.mom.DefinitionObject
Parameters:
xmlDoc - The XML doc to load from.
name - The name of the Property.

Business Components