|
Oracle9i Business Components for Java API Reference Oracle9i Jdeveloper (9.0.4) B10391-01 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
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.EntityDefImpl
Defines metadata for Entity Object classes.
Field Summary | |
static java.lang.String |
DBOBJ_TYPE_OBJTAB |
static java.lang.String |
DBOBJ_TYPE_OBJTYP |
static java.lang.String |
DBOBJ_TYPE_TABLE |
static java.lang.String |
DBOBJ_TYPE_VIEW |
protected com.sun.java.util.collections.ArrayList |
mAssocAccessors The Association accessors for the Entity Object. |
protected com.sun.java.util.collections.ArrayList |
mAssocs Association objects for this Entity Object. |
protected com.sun.java.util.collections.ArrayList |
mAttrAccessors The Attribute accessors for the Entity Object. |
protected int |
mBatchThreshold |
protected java.lang.Class |
mComponentClass |
protected AttributeDefImpl[] |
mFKeys List of attributes that comprise the foreign key. |
protected boolean |
mIsObjectTable Determines if the current table is an Object Table. |
protected AttributeDefImpl |
mOIDAttribute If entity is a OIDObject |
protected AttributeDefImpl[] |
mPrimaryKeys List of attributes that comprise the primary key. |
protected java.lang.String |
mSource Stores the name of the database source: the database entity for the Entity Object. |
protected java.lang.String |
mSourceType Stores the database source type. |
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 | |
protected |
EntityDefImpl() Default Constructor, sets the row class. |
Method Summary | |
protected void |
addEntityAssociation(EntityAssociation assoc) Internal: Applications should not use this method. |
protected void |
addPropertyChangeListener(int index, PropertyChangeListener listener) Adds a PropertyChangeListener to the listener list for an attribute at the given index. |
protected void |
addPropertyChangeListener(java.lang.String attributeName, PropertyChangeListener listener) Adds a PropertyChangeListener to the listener list for an attribute of the given Name. |
protected void |
addUniquePKValidation() Adds validators to each primary key attribute of this Entity to ensure that the primary key for an Entity is always unique. |
protected void |
addVetoableChangeListener(int index, VetoableChangeListener listener) Adds a VetoableChangeListener to the listener list for an attribute at the given index. |
protected void |
addVetoableChangeListener(java.lang.String attributeName, VetoableChangeListener listener) Adds a VetoableChangeListener to the listener list for an attribute of the given name. |
protected void |
addVetoableChangeListener(VetoableChangeListener listener) Adds a VetoableChangeListener to the listener list. |
static boolean |
checkEntityLocked(Row en) Internal: Applications should not use this method. Called by BaseLobDomain to check for entity's locked state in local mode using reflection rather than direct call as Domains need to be "server" independent. |
protected EntityImpl |
createBlankInstance(DBTransaction txn) Internal: Applications should not use this method. |
protected void |
createDef() This method should be used to perform custom-metadata initialization in a subclass of EntityDefImpl. |
protected EntityImpl |
createInstance(DBTransaction txn, AttributeList al) Instantiate an instance of the Entity . |
Key |
createKey(AttributeList al) Given a set of attribute values (name-value pairs), creates a Primary key object for this Entity. |
oracle.jbo.server.ejb.cmp.PStore |
createStore(oracle.jbo.server.ejb.cmp.Persistent p) |
protected boolean |
discrValuesQualify(java.lang.Object[] values) |
boolean |
exists(java.lang.Object pk) |
AttributeDef |
findAttributeDef(java.lang.String name) Gets an attribute definition, given its name. |
EntityImpl |
findByPrimaryKey(DBTransaction txn, Key key) Finds an Entity Object given a Primary Key. |
protected oracle.jbo.server.RowDef |
findDefForDiscrValues(java.lang.Object[] values, boolean recurse) |
static EntityDefImpl |
findDefObject(java.lang.String defFullName) Finds the named Entity Object definition. |
EntityImpl |
findInCacheByPrimaryKey(DBTransaction txn, Key key) Returns an Entity Object in EntityCache given a Primary Key. |
protected void |
finishedLoading() |
java.lang.String |
getAliasName() Returns the database alias that was declared for this definition object at Design-Time. |
oracle.jbo.server.java.util.Iterator |
getAllEntityInstances(DBTransaction tr) Deprecated. since 5.0 use getAllEntityInstancesIterator. |
com.sun.java.util.collections.Iterator |
getAllEntityInstancesIterator(DBTransaction tr) Creates an iterator for stepping through instances of Entities of this definition object type. |
protected AssociationDefImpl |
getAssociationDefImpl(int index) Returns the AssociationDefImpl (association accessors) given an index. |
protected AssociationDefImpl |
getAssociationDefImpl(java.lang.String name) Returns the AssociationDefImpl (association accessors) given the association name. |
protected AssociationDefImpl[] |
getAssociationDefImpls() Returns the AssociationDefImpls. |
int |
getAttributeCount() Returns the number of defined attributes. |
AttributeDef |
getAttributeDef(int index) Gets an attribute definition, given its index. |
AttributeDefImpl |
getAttributeDefImpl(int index) Given the attribute's column position (index) in the database, returns the attribute definition object. |
AttributeDefImpl |
getAttributeDefImpl(java.lang.String attrName) Given an attribute name, returns the attribute definition object. |
protected AttributeDefImpl |
getAttributeDefImplByColumnName(java.lang.String colName) Given an attribute's column name, returns the attribute definition object. |
protected AttributeDefImpl[] |
getAttributeDefImpls() Returns the AttributeDefImpls objects for this Entity Object. |
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. |
protected AttributeDefImpl |
getChangeIndicatorColumn() Returns the AttributeDef for the Change Indicator column for the datasource. |
java.lang.Class |
getCollClass() Gets the implementation class of this Entity's collection. |
protected java.lang.Class |
getComponentClass() Internal: Applications should not use this method. |
protected AttributeDefImpl[] |
getDiscrColumns() Returns the AttributeDef's of the discriminator columns. |
java.lang.String |
getEJBAppProviderURL() |
java.lang.Object |
getEJBHome() |
java.lang.String |
getEJBHomeJNDIName() |
protected EntityAssociation[] |
getEntityAssociations() Internal: Applications should not use this method. |
protected AttributeDefImpl[] |
getForeignKeyAttrs() Returns the list of AttributeDefs that make the foreign key for the composition cases. |
static int |
getMaxAttrConst(java.lang.String entityName) Returns the index of the last attribute for this entity at runtime. |
java.lang.Class |
getMessageBundleClass() Internal: Applications should not use this method. |
protected AttributeDefImpl |
getOIDAttribute() Internal: Applications should not use this method. |
oracle.jbo.server.PackageDefImpl |
getPackageDef() |
java.lang.String |
getPackageName() |
protected AttributeDefImpl[] |
getPrimaryKeys() Returns the AttributeDef's that define the primary key. |
java.lang.String |
getQuery() Returns the query that will return all columns for this Entity. |
int |
getRefAttrIndex() |
protected AttributeDefImpl[] |
getRetrievedOnInsertAttributes() Returns the list of attributes for which the Refresh on Insert flag is enabled at Design Time. |
protected AttributeDefImpl[] |
getRetrievedOnInsertPrimaryKeys() Returns the list of primary keys for which the Refresh on Insert flag is enabled at Design Time. |
protected AttributeDefImpl[] |
getRetrievedOnUpdateAttributes() Returns the list of attributes for which the Refresh on Update flag is enabled at Design Time. |
protected AttributeDefImpl[] |
getRetrievedOnUpdatePrimaryKeys() Returns the list of primary key attributes for which the Refresh on Update flag is enabled at Design Time. |
java.lang.Class |
getRowClass() Gets the implementation class of this Entity's rows. |
java.lang.String |
getSource() Returns the name of the Database source table. |
protected java.lang.String |
getSourceType() Internal: Applications should not use this method. |
AttributeDefImpl[] |
getUniqueKeys() Returns the list of attributes that were marked as Unique-key constituents in designtime The order of attribute definitions is the order in which the unique-key attributes appear in the set of attributes for this entity. |
protected boolean |
hasLOBAttrs() Determines whether the EntityDef contains attributes that are LOBs. |
protected boolean |
isObjectTable() Determines whether this is an Object table. |
protected boolean |
isOIDInPrimaryKey() Determines whether the OID (object identifier) attribute is a primary key. |
boolean |
isRefPKBased() Indicates whether this Entity's REF is primary key based or not. |
protected boolean |
isRowIDPrimaryKey() Determines whether this Entity Object has a ROWID attribute that is used as a primary key. |
protected boolean |
isUpdateChangedColumns() Determines whether the SQL generation of UPDATE statements should include all of the columns or just the changed columns. |
boolean |
isUseReturningClause() Indicates if DML should use the RETURNING clause for this entity type. |
protected void |
loadCustomDef(oracle.jbo.mom.xml.DefElementImpl xmlElement) Internal: Applications should not use this method. |
protected void |
loadProperties(oracle.jbo.mom.xml.DefElementImpl xmlElement) |
oracle.jbo.server.ejb.cmp.PStore |
loadStore(oracle.jbo.server.ejb.cmp.Persistent p) |
AttributeDef |
lookupAttributeDef(java.lang.String name) Gets an attribute definition, given its name. |
java.lang.Object |
queryAsCollection(java.lang.String viewDefName, java.lang.Object[] voParams) |
void |
registerDefObject() Registers this Row Def with MetaObjectManager. |
protected void |
removePropertyChangeListener(int index, PropertyChangeListener listener) Removes a PropertyChangeListener from the listener list of the given attribute (by index). |
protected void |
removePropertyChangeListener(java.lang.String attributeName, PropertyChangeListener listener) Removes a PropertyChangeListener from the listener list of the given attribute (by index). |
protected void |
removeVetoableChangeListener(int index, VetoableChangeListener listener) Removes a VetoableChangeListener from the listener list of the given attribute (by index). |
protected void |
removeVetoableChangeListener(java.lang.String attributeName, VetoableChangeListener listener) Removes a VetoableChangeListener from the listener list of the given attribute (by index). |
protected void |
removeVetoableChangeListener(VetoableChangeListener listener) Removes a VetoableChangeListener from the listener list. |
protected void |
resolveReferences() Since this gets called from lazyload, load all attribute accessors upfront. |
protected void |
setBaseDefObject(oracle.jbo.mom.DefinitionObject baseDefObject) |
void |
setBindingStyle(int bindingStyle) Sets the Oracle or JDBC binding style defined for this Entity definition. |
protected void |
setCollClass(java.lang.Class collClass) Internal: Applications should not use this method. |
protected void |
setDiscrColumns(AttributeDefImpl[] discrCols) Sets the AttributeDef's of the discriminator columns. |
void |
setEJBAppProviderURL(java.lang.String url) |
void |
setEJBHomeJNDIName(java.lang.String nam) |
protected void |
setMessageBundleClass(java.lang.Class collClass) Internal: Applications should not use this method. |
protected void |
setName(java.lang.String name) Name this object. |
protected void |
setParent(NamedObjectImpl parent) Sets this object's parent. |
void |
setRefPKBased(boolean val) Internal: Applications should not use this method. |
protected void |
setRowClass(java.lang.Class rowClass) Internal: Applications should not use this method. |
protected void |
setSource(java.lang.String source) Internal: Applications should not use this method. |
protected void |
setSourceType(java.lang.String sourceType) Internal: Applications should not use this method. |
protected void |
setUseReturningClause(boolean flag) Subclasses should call this method with false, on the EntityDef to indicate that this entity type should not use RETURNING clause to fetch refresh-on-insert or refresh-on-update values. |
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 |
public static final java.lang.String DBOBJ_TYPE_TABLE
public static final java.lang.String DBOBJ_TYPE_VIEW
public static final java.lang.String DBOBJ_TYPE_OBJTYP
public static final java.lang.String DBOBJ_TYPE_OBJTAB
protected com.sun.java.util.collections.ArrayList mAttrAccessors
protected com.sun.java.util.collections.ArrayList mAssocAccessors
protected com.sun.java.util.collections.ArrayList mAssocs
protected AttributeDefImpl[] mFKeys
protected AttributeDefImpl[] mPrimaryKeys
protected AttributeDefImpl mOIDAttribute
protected java.lang.String mSource
protected java.lang.String mSourceType
protected boolean mIsObjectTable
protected int mBatchThreshold
protected java.lang.Class mComponentClass
Constructor Detail |
protected EntityDefImpl()
Method Detail |
public static EntityDefImpl findDefObject(java.lang.String defFullName)
This method takes the fully qualified name (package_name.Entity_name) of an Entity definition and returns the corresponding Entity definition object. This method can be used to return only the Entity Object defintion object, instead of the more global methods in the MetaObjectManager
class.
The following example returns the EntityDef object associated with the Categories Entity in package1.
mDefinitionObject = (EntityDefImpl)EntityDefImpl.findDefObject("package1.Categories");
defFullName
- the fully qualified name of the definition.MetaObjectManager
protected void createDef()
Override this method to satisfy your application's specific custom properties for the Entity definition. For example, you would override this method if your application builds custom properties programatically based on user preferences.
Subclasses of EntityDefImpl should invoke addUniquePKValidation()
in this method to add primary key validators. For example:
protected void createDef() { addUniquePKValidation(); }By default, the framework does not invoke the unique key check.
addUniquePKValidation()
protected EntityAssociation[] getEntityAssociations()
Returns an array of Entity Association objects for this Entity.
protected void addEntityAssociation(EntityAssociation assoc)
Adds an Entity Association to this Entity.
assoc
- the entity assocition to be added.public AttributeDefImpl getAttributeDefImpl(java.lang.String attrName)
This method takes the string name of an Entity Object attribute and returns the corresponding attribute definition object. For example, use this method to get the attribute definition object to store custom properties.
attrName
- the specified Entity attribute.public AttributeDefImpl getAttributeDefImpl(int index)
This method takes the Entity attribute's database column position (index) and returns the corresponding attribute definition object. For example, use this method to get the attribute definition object to store custom properties.
index
- the attribute's database column position, where the leftmost column has index 0.protected AttributeDefImpl getAttributeDefImplByColumnName(java.lang.String colName)
This method takes the Entity attribute's database colunm name and returns the corresponding attribute definition object. For example, use this method to get the attribute definition object to store custom properties.
colName
- the name of the attribute's column in the database.protected AttributeDefImpl[] getAttributeDefImpls()
getAttributeDefImpls
in class oracle.jbo.server.RowDef
public AttributeDef[] getAttributeDefs()
StructureDef
getAttributeDefs
in interface StructureDef
getAttributeDefs
in class oracle.jbo.server.RowDef
public int getAttributeCount()
StructureDef
getAttributeCount
in interface StructureDef
getAttributeCount
in class oracle.jbo.server.RowDef
public AttributeDef findAttributeDef(java.lang.String name)
StructureDef
findAttributeDef
in interface StructureDef
findAttributeDef
in class oracle.jbo.server.RowDef
name
- the name of an AttributeDef
.public AttributeDef lookupAttributeDef(java.lang.String name)
StructureDef
lookupAttributeDef
in interface StructureDef
lookupAttributeDef
in class oracle.jbo.server.RowDef
name
- the name of an AttributeDef
.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.protected AssociationDefImpl getAssociationDefImpl(java.lang.String name)
name
- the name of the association.protected AssociationDefImpl getAssociationDefImpl(int index)
index
- of the association attribute.protected AssociationDefImpl[] getAssociationDefImpls()
public java.lang.String getSource()
This method could be overridden if, for example, your application implements table generator code at runtime.
protected void setSource(java.lang.String source)
Sets the name of the Database source table.
source
- the name of database table corresponding to this business object.protected boolean isObjectTable()
This method returns true if this table is:
protected java.lang.String getSourceType()
Returns the name of the database source type.
protected void setSourceType(java.lang.String sourceType)
Sets the name of the Database source type.
public java.lang.String getEJBHomeJNDIName()
public void setEJBHomeJNDIName(java.lang.String nam)
public java.lang.String getEJBAppProviderURL()
public void setEJBAppProviderURL(java.lang.String url)
public oracle.jbo.server.java.util.Iterator getAllEntityInstances(DBTransaction tr)
tr
- the transaction containing the Entity Objects.public com.sun.java.util.collections.Iterator getAllEntityInstancesIterator(DBTransaction tr)
tr
- the transaction containing the Entity Objects.public java.lang.Class getRowClass()
getRowClass
in class oracle.jbo.server.RowDef
public java.lang.Class getCollClass()
public EntityImpl findInCacheByPrimaryKey(DBTransaction txn, Key key)
Given the name of the databse transaction and the table's primary key, this method returns the associated Entity Object if it exists in the Entity cache. This method will not cause a fault-in of an entity from the database.
This method returns null if the Entity Object is not found.
txn
- the transaction containing the Entity Object.key
- the Primary Key.public EntityImpl findByPrimaryKey(DBTransaction txn, Key key)
Given the name of the databse transaction and the table's primary key, this method returns the associated Entity Object. If the Entity has not already been brought into the cache by any of the View Objects, this method will cause the Entity to be fetched from the database.
This method returns null if the Entity Object is not found.
txn
- the transaction containing the Entity Object.key
- the Primary Key.public Key createKey(AttributeList al)
protected EntityImpl createInstance(DBTransaction txn, AttributeList al)
Entity
. The default values of the entity attributes are filled in in this method.
Override this method to create instances of composite Entities.
txn
- the DBTransaction instance for the Entity.al
- List of attribute name/value pairs to be passed to Entity.create()EntityImpl.create(AttributeList)
protected EntityImpl createBlankInstance(DBTransaction txn)
Internal method invoked whenever an Entity of this type is created within the framework.
txn
- the Database Transaction Object.protected void setRowClass(java.lang.Class rowClass)
Sets the implementation class for this Entity's rows.
rowClass
- the row implementation class.protected void setCollClass(java.lang.Class collClass)
Sets the implementation class for this Entity's collection.
collClass
- the collection implementation class.protected java.lang.Class getComponentClass()
Returns the class of the reference object.
getComponentClass
in class oracle.jbo.server.DefObject
protected AttributeDefImpl[] getForeignKeyAttrs()
protected AttributeDefImpl[] getPrimaryKeys()
protected AttributeDefImpl getOIDAttribute()
Returns the object identifier attribute (OID). This method is used to return attributes that are Oracle Objects.
protected AttributeDefImpl[] getRetrievedOnInsertAttributes()
protected AttributeDefImpl[] getRetrievedOnUpdateAttributes()
protected AttributeDefImpl[] getRetrievedOnInsertPrimaryKeys()
protected AttributeDefImpl[] getRetrievedOnUpdatePrimaryKeys()
public AttributeDefImpl[] getUniqueKeys()
protected AttributeDefImpl getChangeIndicatorColumn()
The Change Indicator column is used, in some applications, to indicate changes in the underlying row in the datastore. It usually takes the form of a Timestamp or a Counter and, is compared at change time, against the value in the cache, to check for consistency.
protected boolean isUpdateChangedColumns()
The return value of this flag indicates whether the SQL Generation of UPDATE statements should include all of the columns or just the changed columns. If this method returns true then only the updated columns will be included, otherwise the method will include all of the columns that are present.
public java.lang.String getQuery()
protected void addPropertyChangeListener(int index, PropertyChangeListener listener)
PropertyChangeListener
to the listener list for an attribute at the given index.
This method modifies the static/singleton metadata.
index
- the index of the attribute to which the listener is to be added.listener
- the PropertyChangeListener
to be added.PropertyChangeListener
protected void addPropertyChangeListener(java.lang.String attributeName, PropertyChangeListener listener)
PropertyChangeListener
to the listener list for an attribute of the given Name.
This method modifies the static/singleton metadata.
attributeName
- the name of the attribute to which the listener is to be added.listener
- the PropertyChangeListener
to be added.PropertyChangeListener
protected void removePropertyChangeListener(int index, PropertyChangeListener listener)
PropertyChangeListener
from the listener list of the given attribute (by index).
This method modifies the static/singleton metadata.
listener
- the PropertyChangeListener to be removed.PropertyChangeListener
protected final void removePropertyChangeListener(java.lang.String attributeName, PropertyChangeListener listener)
PropertyChangeListener
from the listener list of the given attribute (by index).
This method modifies the static/singleton metadata.
attributeName
- the attribute to which the listener is to be added.listener
- the PropertyChangeListener
to be removed.PropertyChangeListener
protected void addVetoableChangeListener(VetoableChangeListener listener)
VetoableChangeListener
to the listener list.
This method modifies the static/singleton metadata.
listener
- the VetoableChangeListener
to be added.VetoableChangeListener
protected void addVetoableChangeListener(int index, VetoableChangeListener listener)
VetoableChangeListener
to the listener list for an attribute at the given index. Use this method to add a validator to an attribute.
This method modifies the static/singleton metadata.
index
- the index of the attribute to which the listener is to be added.listener
- the VetoableChangeListener
to be added.VetoableChangeListener
protected void addVetoableChangeListener(java.lang.String attributeName, VetoableChangeListener listener)
VetoableChangeListener
to the listener list for an attribute of the given name.
This method modifies the static/singleton metadata.
attributeName
- the attribute to which the listener is to be added.listener
- the VetoableChangeListener
to be added.VetoableChangeListener
protected void removeVetoableChangeListener(VetoableChangeListener listener)
VetoableChangeListener
from the listener list.
This method modifies the static/singleton metadata.
listener
- the VetoableChangeListener
to be removed.VetoableChangeListener
protected void removeVetoableChangeListener(int index, VetoableChangeListener listener)
VetoableChangeListener
from the listener list of the given attribute (by index).
This method modifies the static/singleton metadata.
index
- the index of the attribute from which the listener is to be removed.listener
- the VetoableChangeListener
to be removed.VetoableChangeListener
protected final void removeVetoableChangeListener(java.lang.String attributeName, VetoableChangeListener listener)
VetoableChangeListener
from the listener list of the given attribute (by index).
This method modifies the static/singleton metadata.
attributeName
- the attribute to which the listener is to be added.listener
- the VetoableChangeListener
to be removed.VetoableChangeListener
protected void finishedLoading()
finishedLoading
in class oracle.jbo.server.DefObject
protected void resolveReferences()
resolveReferences
in class oracle.jbo.server.DefObject
public boolean isRefPKBased()
public void setRefPKBased(boolean val)
Sets a flag that indicates whether this Entity's REF is primary key based or not. This method is meaningful only for an Entity whose base table is an Oracle object table. For such an Entity, a question arises whether the object reference ("REF") for the table is primary key based or not. This method sets this flag.
val
- should be true if the underlying object table's REF is primary key based. Otherwise, false.public int getRefAttrIndex()
protected boolean isRowIDPrimaryKey()
protected boolean isOIDInPrimaryKey()
protected void addUniquePKValidation()
Whenever any of the primary key attribute values change, this validation rule is invoked to validate, both in the cache and the database, that the new key does not belong to any other Entity of this type. If the key is found in one of the Entities, a TooManyObjectsException
is thrown.
Subclasses should invoke this method in their createDef() method to add these validators. By default, the framework does not invoke the unique key check. For example, you can add a validator to look for duplicate keys. To do this, follow these instructions:
protected void createDef() { addUniquePKValidation(); }This enables validation to check if the modified primary key value exists in either the database or the cache.
An alternative way to apply this validator in designtime is to edit the entity in designtime and apply UniqueKeyValidator to the entity in the Rules Tab.
TooManyObjectsException
- if a duplicate key is found.createDef()
, TooManyObjectsException
protected void loadCustomDef(oracle.jbo.mom.xml.DefElementImpl xmlElement) throws PersistenceException
Loads a custom Entity definition from the associated XML file. For example, add custom attributes or additional metadata to an Entity's XML file. Then use this method to load the new definition of the Entity definition.
Typically, a call to createDef() follows this method.
xmlElement
- the root XML node for the Entity.PersistenceException
- if an error occurred while loading the XML files at runtime.createDef()
protected boolean hasLOBAttrs()
This method is used by doDML
to determine if the EntityDef contains LOB attributes. If it does, doDML calls doDMLWithLOBs
to process the DML request. For example:
protected void doDML(int operation, TransactionEvent e) { if (!getEntityDef().hasLOBAttrs()) { getSQLBuilder().doEntityDML(this,operation,e); } else { doDMLWithLOBs(operation, e); } }Developers who implement doDML() to handle the two-phase insert and update process, should override hasLOBAttrs() in the EntityDefImpl subclass and return false. This will cause doDML() to work properly with the current release.
doDML
, doDMLWithLOBs
public static int getMaxAttrConst(java.lang.String entityName)
The framework's Extends feature lets developers add information, such as additional attributes and validation, to an existing Entity. The additional attributes are "appended" to the original Entity's list of attributes. The framework adds this method to the generated extended Entity's *Impl file and uses it at runtime to determine the index of the last attribute belonging to the original Entity. All of the attributes with index greater than this number belong to the extended Entity.
The following code snippet represents part of the class definition of the *Impl file generated by the framework for the extended Entity Object newEmp:
public class newEmpImpl extends package27.EmpImpl { protected static final int MAXATTRCONST = EntityDefImpl.getMaxAttrConst("package27.Emp"); ...The getMaxAttrConst method returns the index of the last attribute from the EntityDefImpl belonging to the original Entity Emp in package27. The result is stored in the constant MAXATTRCONST. This constant is used in calculations later in the file.
entityName
- the name of the Entity for which the index of the last attribute is retrieved.public oracle.jbo.server.ejb.cmp.PStore createStore(oracle.jbo.server.ejb.cmp.Persistent p)
createStore
in interface oracle.jbo.server.ejb.cmp.PStoreDescriptor
public oracle.jbo.server.ejb.cmp.PStore loadStore(oracle.jbo.server.ejb.cmp.Persistent p)
loadStore
in interface oracle.jbo.server.ejb.cmp.PStoreDescriptor
public boolean exists(java.lang.Object pk)
exists
in interface oracle.jbo.server.ejb.cmp.PStoreDescriptor
public java.lang.Object queryAsCollection(java.lang.String viewDefName, java.lang.Object[] voParams)
queryAsCollection
in interface oracle.jbo.server.ejb.cmp.PStoreDescriptor
public static boolean checkEntityLocked(Row en)
public java.lang.Object getEJBHome()
protected void setUseReturningClause(boolean flag)
By default, this flag is set. If a subclass resets this flag, then callable statements for insert/update DML on entities of this type will contain a separate SELECT statement to fetch the refresh-on-insert or update attributes. In that case, Entity.getRefreshSQLKeyAttrs()
is used to get the list of attributes to create the WHERE clause for this extra SELECT statement.
public boolean isUseReturningClause()
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 All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2003, Oracle. All rights reserved.