Oracle ADF Model and Business Components API Reference 10.1.2 B14022-01

oracle.jbo.server.ejb.facade
Class EntityFacadeCollImpl

java.lang.Object
  extended byoracle.jbo.server.EntityCache
      extended byoracle.jbo.server.ejb.facade.EntityFacadeCollImpl
All Implemented Interfaces:
StructureDef

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.


Constructor Summary
EntityFacadeCollImpl()
          Constructs an Entity Facade Collection.
 
Method Summary
protected  EJBLocalObject createBean(EntityFacadeImpl ent)
          Creates an Entity Bean instance.
protected abstract  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  EJBLocalHome getEJBLocalHome()
          An abstract method which returns the Entity Bean Home reference.
protected  void initEJBHome()
          Initializes connection to the Entity Bean Home.
protected abstract  EJBLocalObject invokeCreate(EntityFacadeImpl ent)
          An abstract method which creates a new Entity Bean.
protected abstract  void setEJBLocalHome(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, addRowByDeletedPK, clearCache, closeStatements, createPreparedStatement, deliverEntityEvent, findAttributeDef, getAttributeCount, getAttributeDef, getAttributeDefs, getAttributeIndexOf, getDefFullName, getDefName, getEntityDef, getFullName, getName, getPreparedSelectStatement, init, isAssociationAccessorRetained, isBatchable, lookupAttributeDef, removeEntityListener, removeRow, removeRowByDeletedPK, removeRowByOldPK, replace, setAssociationAccessorRetained
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 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(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 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 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 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 ADF Model and Business Components API Reference 10.1.2 B14022-01

 

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