|
Oracle9i Business Components for Java API Reference Oracle9i Jdeveloper (9.0.4) B10391-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--oracle.jbo.common.NamedObjectImpl | +--oracle.jbo.mom.DefinitionObject | +--oracle.jbo.server.DefObject | +--oracle.jbo.server.RowDef | +--oracle.jbo.server.ViewDefImpl
ViewDefImpl is the meta-object for View Object instances. It describes the View Object's structure.
A View Def can be created either through XML loading or programmatically. For the former, the client is expected to generate the XML file from design-time and make the file accessible from the classpath. When the client asks MetaObjectManager for the View Def, it finds the XML file, opens it, parses it, and builds a View Def from it.
When creating a View Def programmatically, the client is expected to start with
ViewDefImpl viewDef = new ViewDefImpl("MyViewDef");
where "MyViewDef" is the name by which the View Def will identified by MetaObjectManager. This is the name that the client should pass when an API requires a View Def name, e.g., the defName
parameter to
.ApplicationModule.createViewObject(String, String)
After instantiating the View Def, the client adds entity usages, attributes, etc. Then, he must resolve the definition object through
and regsiter it with MetaObjectManager through resolveDefObject()
. For a View Def created from an XML file, the client does not need to call these methods, as the framework calls them itself.RowDef.registerDefObject()
Here is an example code snippet:
ViewDefImpl viewDef = new ViewDefImpl("MyViewDef"); viewDef.addEntityUsage("MyEmpUsage", "testp.kava.VO3.si03mt.Emp", false); // false means it's not refOnly viewDef.setComponentClass(null); // take the default ViewObjectImpl viewDef.setRowClass(null); // take the default ViewRowImpl viewDef.setSelectClause("EmpUsage.EMPNO, EmpUsage.ENAME, EmpUsage.JOB, EmpUsage.DEPTNO"); viewDef.setFromClause("EMP EmpUsage"); viewDef.addEntityAttribute("MyEmpNum", "MyEmpUsage", "EmpNum", true); // true is for persistent viewDef.addEntityAttribute("MyEmpName", "MyEmpUsage", "EmpName", true); viewDef.addEntityAttribute("MyEmpJob", "MyEmpUsage", "EmpJob", true); viewDef.addEntityAttribute("MyEmpDeptNum", "MyEmpUsage", "EmpDeptNum", true); viewDef.resolveDefObject(); viewDef.registerDefObject();
Field Summary | |
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) Constructs a ViewDefImpl. |
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) Deprecated. since 9.0.3, use addEntityUsage() that takes readOnly flag as well. |
void |
addEntityUsage(java.lang.String usageName, java.lang.String entityDefName, boolean referenceOnly, boolean readOnly) |
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) |
void |
addEntityUsage(java.lang.String usageName, java.lang.String entityDefName, boolean referenceOnly, java.lang.String assocName, java.lang.String assocEndName, java.lang.String srcUsageName) Deprecated. since 9.0.3, use addEntityUsage() that takes readOnly flag as well. |
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 attribute definition by the attribute name. |
protected oracle.jbo.server.RowDef |
findDefForDiscrValues(java.lang.Object[] values, boolean recurse) |
static ViewDefImpl |
findDefObject(java.lang.String viewDefName) Finds the ViewDefImpl from the list of Meta Objects. |
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() Gets an array of attribute definitions in this View Def. |
AttributeDef[] |
getAttributeDefs() Gets an array of attribute definitions in this View Def. |
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. |
java.lang.String |
getEJBAppProviderURL() |
java.lang.Object |
getEJBHome() |
java.lang.String |
getEJBHomeJNDIName() |
protected oracle.jbo.server.EntityReference |
getEntityReference(int index) |
protected oracle.jbo.server.EntityReference |
getEntityReference(java.lang.String name) Returns the EntityReference of the given name . |
protected oracle.jbo.server.EntityReference[] |
getEntityReferences() 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() |
int |
getIterMode() |
int |
getMaxActiveNodes() |
static int |
getMaxAttrConst(java.lang.String viewDefName) |
int |
getMaxFetchSize() |
int |
getMaxRowsPerNode() |
java.lang.Class |
getMessageBundleClass() Internal: Applications should not use this method. |
java.lang.String |
getOrderByClause() |
oracle.jbo.server.PackageDefImpl |
getPackageDef() |
java.lang.String |
getPackageName() |
java.lang.String |
getQuery() Returns the query set via setQuery or via expert mode query at designtime. |
java.lang.String |
getQueryHint() |
java.lang.Class |
getRowClass() |
java.lang.String |
getSelectClause() |
protected StmtWithBindVars |
getWhereClause(int noBindVars) |
java.lang.String |
getXMLElementTag() |
java.lang.String |
getXMLRowElementTag() |
protected boolean |
hasPrimaryEntity() |
boolean |
hasQuery() |
protected boolean |
isDynamic() |
boolean |
isFinderView() |
boolean |
isFullSql() |
boolean |
isManageRowsByKey() |
boolean |
isPassivationEnabled() |
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() Registers this Row Def with MetaObjectManager. |
void |
resolveDefObject() Resolves this View Def. |
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 |
setIterMode(int iterMode) |
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 |
setMessageBundleClass(java.lang.Class collClass) Internal: Applications should not use this method. |
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) Sets the string for a user-defined 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 |
protected java.lang.Class mComponentClass
Constructor Detail |
public ViewDefImpl(java.lang.String name)
name
- name by which this View Def will be registered in MetaObjectManager.Method Detail |
public static ViewDefImpl findDefObject(java.lang.String viewDefName)
MetaObjectManager
public static int getMaxAttrConst(java.lang.String viewDefName)
protected AttributeDefImpl[] getAttributeDefImpls()
getAttributeDefImpls
in class oracle.jbo.server.RowDef
public AttributeDef[] getAttributeDefs()
getAttributeDefs
in interface StructureDef
getAttributeDefs
in class oracle.jbo.server.RowDef
public AttributeDef findAttributeDef(java.lang.String attrName)
findAttributeDef
in interface StructureDef
findAttributeDef
in class oracle.jbo.server.RowDef
attrName
- name of the attribute.NoDefException
- thrown if the named atribute is not found.public AttributeDef lookupAttributeDef(java.lang.String attrName)
lookupAttributeDef
in interface StructureDef
lookupAttributeDef
in class oracle.jbo.server.RowDef
attrName
- the name of an AttributeDef
.null
if not found.protected oracle.jbo.server.EntityReference[] getEntityReferences()
EntityReference
's upon which this ViewObject is based. Each EntityReference
refers to EntityDef
that describes the Entity.EntityReference
array.public boolean isManageRowsByKey()
protected oracle.jbo.server.EntityReference getEntityReference(java.lang.String name)
EntityReference
of the given name
. name
is the Entity usage name of this ViewObject's Entity base.
If no matching EntityReference
is found, it returns null
.
name
- the Entity usage name.EntityReference
. null
if no matching Entity usage is found.protected oracle.jbo.server.EntityReference getEntityReference(int index)
public java.lang.String getQuery()
public void setQuery(java.lang.String query)
isFullSql
is set to true if this call is used to set a non-null value. If the parameter is null, then the isFullSql flag is set to false, so that the component parts of the SQL can be set with the setSelectClause(), setFromClause(), and setWhereClause() methods.public void setQueryHint(java.lang.String queryHint)
public java.lang.String getQueryHint()
public int getCalculatedAttributeCount()
public int getAttributeCount()
StructureDef
getAttributeCount
in interface StructureDef
getAttributeCount
in class oracle.jbo.server.RowDef
public AttributeDef getAttributeDef(int index)
StructureDef
getAttributeDef
in interface StructureDef
getAttributeDef
in class oracle.jbo.server.RowDef
index
- the index of an AttributeDef
, where the leftmost attribute has index zero.public void setRowClass(java.lang.Class rowClass)
rowClass
- The Class of the instance.public java.lang.Class getRowClass()
getRowClass
in class oracle.jbo.server.RowDef
public void setComponentClass(java.lang.Class componentClass)
componentClass
- The Class of the instance.public java.lang.Class getComponentClass()
getComponentClass
in class oracle.jbo.server.DefObject
public java.lang.String getSelectClause()
public void setSelectClause(java.lang.String selectClause)
selectClause
- The SELECT listpublic java.lang.String getFromClause()
public void setFromClause(java.lang.String fromClause)
fromClause
- The FROM clauseprotected StmtWithBindVars getWhereClause(int noBindVars)
public void setWhereClause(java.lang.String whereClause)
whereClause
- The WHERE clausepublic java.lang.String getOrderByClause()
public void setOrderByClause(java.lang.String orderByClause)
orderByClause
- The ORDER BY clausepublic byte getFetchMode()
public void setFetchMode(byte fetchMode)
fetchMode
- is FETCH_AS_NEEDED, FETCH_ALL or FETCH_DEFAULT.public short getFetchSize()
public void setFetchSize(short size)
size
- the size, in rows, of the chunk to fetch.public int getMaxFetchSize()
public void setMaxFetchSize(int size)
size
- the number of rows.public boolean isUseGlueCode()
public void setUseGlueCode(boolean b)
public void setMaxRowsPerNode(int maxRowsPerNode)
public int getMaxRowsPerNode()
public void setMaxActiveNodes(int maxActiveNodes)
public int getMaxActiveNodes()
protected boolean hasPrimaryEntity()
protected void finishedLoading()
finishedLoading
in class oracle.jbo.server.DefObject
protected void resolveReferences()
resolveReferences
in class oracle.jbo.server.DefObject
public void resolveDefObject()
This method must be called after the View Def is set up and before registerDefObject()
.
public void addAllEntityAttributes(java.lang.String entityUsageName)
public AttributeDefImpl addEntityAttribute(java.lang.String attrName, java.lang.String entityUsageName, java.lang.String entityAttrName, boolean isPersistent)
public AttributeDefImpl addViewAttribute(java.lang.String attrName, java.lang.String expression, java.lang.Class javaType)
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)
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)
public void addEntityUsage(java.lang.String usageName, java.lang.String entityDefName, boolean referenceOnly)
public void addEntityUsage(java.lang.String usageName, java.lang.String entityDefName, boolean referenceOnly, boolean readOnly)
public boolean isFullSql()
public void setFullSql(boolean b)
protected boolean isDynamic()
isDynamic
in class oracle.jbo.server.DefObject
public final boolean isPassivationEnabled()
protected void loadCustomDef(oracle.jbo.mom.xml.DefElementImpl xmlElement) throws PersistenceException
PersistenceException
public boolean hasQuery()
public java.lang.String getXMLRowElementTag()
public java.lang.String getXMLElementTag()
public int getIterMode()
public void setIterMode(int iterMode)
public java.lang.String getEJBHomeJNDIName()
public java.lang.String getEJBAppProviderURL()
public boolean isFinderView()
public java.lang.Object getEJBHome()
protected AttributeDefImpl[] getDiscrColumns()
protected void setDiscrColumns(AttributeDefImpl[] discrCols)
discrCols
- an array attribute definitions of the discriminator columns.protected boolean discrValuesQualify(java.lang.Object[] values)
protected oracle.jbo.server.RowDef findDefForDiscrValues(java.lang.Object[] values, boolean recurse)
public int getBindingStyle()
SQLBuilder
interface.SQLBuilder
public void setBindingStyle(int bindingStyle)
SQLBuilder
interface.bindingStyle
- an integer representing the Oracle or JDBC binding style for this Entity definition. The possible values can be:
SQLBuilder
public java.lang.String getAliasName()
protected void setMessageBundleClass(java.lang.Class collClass)
Sets the implementation class for this Object's Message Bundle class.
collClass
- the message bundle implementation class.public java.lang.Class getMessageBundleClass()
Returns the class of the reference object.
public void registerDefObject()
This method should be called after the Row Def is all set up and after resolveDefObject()
is called.
public oracle.jbo.server.PackageDefImpl getPackageDef()
public java.lang.String getPackageName()
protected void setName(java.lang.String name)
setName
in class oracle.jbo.mom.DefinitionObject
name
- the name to be given to this object.public oracle.jbo.mom.DefinitionObject getBaseDefObject()
getBaseDefObject
in class oracle.jbo.mom.DefinitionObject
protected void setBaseDefObject(oracle.jbo.mom.DefinitionObject baseDefObject)
setBaseDefObject
in class oracle.jbo.mom.DefinitionObject
protected void setParent(NamedObjectImpl parent)
setParent
in class oracle.jbo.mom.DefinitionObject
parent
- the named object that is to be the parent of this object.protected void loadProperties(oracle.jbo.mom.xml.DefElementImpl xmlElement)
loadProperties
in class oracle.jbo.mom.DefinitionObject
|
Oracle9i Business Components for Java API Reference Oracle9i Jdeveloper (9.0.4) B10391-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2003, Oracle. All rights reserved.