Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.0.0)

E17483-01

oracle.jbo.server.ejb.facade
Class EntityFacadeCollImpl

java.lang.Object
  extended by oracle.jbo.common.NamedObjectImpl
      extended by oracle.jbo.server.NamedObjectImpl
          extended by oracle.jbo.server.ComponentObjectImpl
              extended by oracle.jbo.server.EntityCache
                  extended by oracle.jbo.server.ejb.facade.EntityFacadeCollImpl
All Implemented Interfaces:
ComponentObject, ExprWrappable, GenericHints, OperationContainer, Properties, ValidationManager, AttributeDependencyManager, StructureDef, VariableManagerOwner, VariableManagerOwnerBase

public abstract class EntityFacadeCollImpl
extends EntityCache

Abstract base class for Entity Facade collections. This class extends EntityCache. Beyond the base EntityCache functionality, this class is responsible for interacting with the Entity Bean Home.

In particular, it has the facility to create a new Entity Bean instance.

When the user builds an Entity Facade for an Entity Bean, a subclass of this class is generated.


Field Summary
 
Fields inherited from class oracle.jbo.common.NamedObjectImpl
mFullName, mObjName, mParent, mProperties, RES_ID_SUFFIX, RESID_SUFFIX
 
Fields inherited from interface oracle.jbo.GenericHints
PROPERTY_LABEL, PROPERTY_LABEL_PLURAL, PROPERTY_TOOLTIP
 
Constructor Summary
EntityFacadeCollImpl()
          Constructs an Entity Facade Collection.
 
Method Summary
protected  javax.ejb.EJBLocalObject createBean(EntityFacadeImpl ent)
          Creates an Entity Bean instance.
protected abstract  javax.ejb.EJBLocalObject findBeanByPrimaryKey(Key eKey)
          An abstract method which returns an Entity Bean of the given primary key.
protected  java.sql.Timestamp getCurrentDbTime()
          Get the current database time for DATE History Column.
protected abstract  javax.ejb.EJBLocalHome getEJBLocalHome()
          An abstract method which returns the Entity Bean Home reference.
protected  void initEJBHome()
          Initializes connection to the Entity Bean Home.
protected abstract  javax.ejb.EJBLocalObject invokeCreate(EntityFacadeImpl ent)
          An abstract method which creates a new Entity Bean.
protected abstract  void setEJBLocalHome(javax.ejb.EJBLocalHome ejbHome)
          An abstract method which stores the Entity Bean Home reference.
protected  void setupEJBHome(javax.naming.Context ic)
          Sets up the Entity Bean Home.
protected  javax.naming.Context setupInitialContext()
          Creates the initial context in preparation for setting up of the Entity Bean Home.
 
Methods inherited from class oracle.jbo.server.EntityCache
add, addDynamicAttribute, addEntityListener, addEventAttr, addForAltKey, addForwardDependency, addRowByDeletedPK, addTrigger, addValidator, clearCache, closeStatements, createEffDtDateDayAddStatement, createPreparedStatement, createPrepStmtForAltKey, deliverEntityEvent, findAttributeDef, findOrCreateLocalViewObject, findViewAccessorDef, get, getAttributeCount, getAttributeDef, getAttributeDefImpls, getAttributeDefs, getAttributeIndexOf, getBackwardDependencies, getBackwardDependencyAttributes, getBaseAttributeCount, getColumnNameForQuery, getComparator, getCreateEvents, getDBTransactionImpl, getDefFullName, getDefName, getDeleteEvents, getEffDtDateDayAddStatement, getEntityDef, getEventDef, getEventNamespace, getEventPayloadNamespace, getForAltKey, getForwardDependencies, getForwardDependencyAttributes, getFullName, getLOBAttrs, getName, getPreparedSelectStatement, getPrepSelStmtForAltKey, getRSI, getTriggersOfType, getUpdateEvents, getValidators, getWithHandle, hasLOBAttrs, hasRows, init, isAssociationAccessorRetained, isBatchable, iterator, iterator, lookupAttributeDef, lookupTrigger, lookupValidator, lookupViewAccessorDef, personalizeTrigger, pin, removeEntityListener, removeRow, removeRowByDeletedPK, removeRowByOldPK, removeRowForAltKey, removeValidator, replace, replace, replaceForAltKey, setAssociationAccessorRetained, unpin, validate
 
Methods inherited from class oracle.jbo.server.ComponentObjectImpl
addListener, applyPersonalization, create, createRef, createVariableValueManager, ensureVariableManager, findOperationDefinitions, findPersDefObject, getAllProperties, getApplicationModule, getCompListeners, getCompListenersList, getDefinitionManager, getFullNameForPersDef, getHintValue, getLabel, getLabelPlural, getMessageBundleClass, getProxyClassName, getProxyClassName, getResourceBundleDef, getRootApplicationModule, getStringFromMessageBundle, getTooltip, getVariableManager, hasVariables, isDead, isPersonalized, isRegWithPiggyMan, remove, resolvePropertyRaw, setName, setParent, setProxyClassName
 
Methods inherited from class oracle.jbo.server.NamedObjectImpl
setParent, setPropertiesMap
 
Methods inherited from class oracle.jbo.common.NamedObjectImpl
allocatePropertyMap, getParent, getProperties, getPropertiesAsStrings, getPropertiesMap, getProperty, getProperty, getPropertyExpressionsMap, getPropertyMap, getResourcesFromBundle, isPropertyExpression, mergePropertyMap, refreshProperty, removeProperty, removeProperty, requiresNamePrefixedResId, resolveObjectProperty, setFullName, setPropertiesMap2, setProperty, setProperty, setPropertyExpression, setPropertyMap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface oracle.jbo.rules.ValidationManager
getResourceBundleDef
 
Methods inherited from interface oracle.jbo.Properties
getProperties, getProperty, getProperty, refreshProperty
 

Constructor Detail

EntityFacadeCollImpl

public EntityFacadeCollImpl()
Constructs an Entity Facade Collection.

Method Detail

initEJBHome

protected void initEJBHome()
Initializes connection to the Entity Bean Home.

Throws:
JboException - if a javax.naming.NamingException is thrown while trying to set up the Entity Bean Home.

setupInitialContext

protected javax.naming.Context setupInitialContext()
                                            throws javax.naming.NamingException
Creates the initial context in preparation for setting up of the Entity Bean Home. This method is called by initEJBHome().

Returns:
the initial context.
Throws:
javax.naming.NamingException - if something goes wrong while setting up the initial context.

setupEJBHome

protected void setupEJBHome(javax.naming.Context ic)
                     throws javax.naming.NamingException
Sets up the Entity Bean Home. This method is called by initEJBHome().

It gets the Entity Bean Home JDNI name from the Entity Definition. It calls an abstract method setEJBLocalHome(javax.ejb.EJBLocalHome).

Parameters:
ic - the initial context.
Throws:
javax.naming.NamingException

getEJBLocalHome

protected abstract javax.ejb.EJBLocalHome getEJBLocalHome()
An abstract method which returns the Entity Bean Home reference.

A subclass of this class has an implementation of this method which returns the Entity Bean Home reference.

Returns:
the Entity Bean Home reference.

setEJBLocalHome

protected abstract void setEJBLocalHome(javax.ejb.EJBLocalHome ejbHome)
An abstract method which stores the Entity Bean Home reference.

A subclass of this class has an implementation of this method which assigns ejbHome to a field of that subclass.

Parameters:
ejbHome - the Entity Bean Local Home to be stored.

findBeanByPrimaryKey

protected abstract javax.ejb.EJBLocalObject findBeanByPrimaryKey(Key eKey)
                                                          throws java.lang.Exception
An abstract method which returns an Entity Bean of the given primary key.

A subclass of this class has an implementation of this method which finds the Entity Bean by the primary key of eKey.

Parameters:
eKey - primary key.
Returns:
the Entity Bean instance of the give primary key.
Throws:
java.lang.Exception - if something goes wrong. If the requested Entity Bean instance is not found, it will throw a javax.ejb.FinderException.

createBean

protected javax.ejb.EJBLocalObject createBean(EntityFacadeImpl ent)
Creates an Entity Bean instance. This method is a wrapper over invokeCreate(EntityFacadeImpl). It first checks to make sure that the Entity Bean Home is initialized. Then, it calls invokeCreate(EntityFacadeImpl) and handles exceptions thrown by invokeCreate(EntityFacadeImpl).

Parameters:
ent - Entity Bean Facade instance from which the Entity Bean instance is to be created.
Returns:
the new Entity Bean instance.
Throws:
JboException - if something goes wrong during the creation process.

invokeCreate

protected abstract javax.ejb.EJBLocalObject invokeCreate(EntityFacadeImpl ent)
                                                  throws java.lang.Exception
An abstract method which creates a new Entity Bean.

A subclass of this class has an implementation of this method which creates a new Entity Bean, passing in the appropriate parameters to the create() method. Then, it uses attribute values of ent to initialize attributes of the Entity Bean.

Parameters:
ent - the Entity Facade instance.
Returns:
the new Entity Bean instance.
Throws:
java.lang.Exception - if something goes wrong. If the Entity Bean's create() method encounters an error, it will throw a javax.ejb.CreateException.

getCurrentDbTime

protected java.sql.Timestamp getCurrentDbTime()
Get the current database time for DATE History Column. Subclasses should override this method to return current database time for the Entity Bean.

Overrides:
getCurrentDbTime in class EntityCache
Returns:
system time.

Oracle Fusion Middleware Java API Reference for Oracle ADF Model
11g Release 2 (11.1.2.0.0)

E17483-01

Copyright © 1997, 2011, Oracle. All rights reserved.