SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.kodo.ee
Class JDOEntityBean

java.lang.Object
  |
  +--com.solarmetric.rd.kodo.ee.JDOBean
        |
        +--com.solarmetric.rd.kodo.ee.JDOEntityBean
All Implemented Interfaces:
javax.ejb.EnterpriseBean, javax.ejb.EntityBean, java.io.Serializable

public abstract class JDOEntityBean
extends JDOBean
implements javax.ejb.EntityBean

Base class that can be used to implement a BMP Entity Bean with a wrapped JDO persistent instance. The behaviour of this wrapper is outlined in section 16.2.1 of the JDO 1.0 specification.

See Also:
Serialized Form

Field Summary
protected  javax.ejb.EntityContext ctx
           
 
Fields inherited from class com.solarmetric.rd.kodo.ee.JDOBean
CM_JNDI_SUFFIX
 
Constructor Summary
JDOEntityBean()
           
 
Method Summary
 java.lang.Object createPersistent()
          Create a new instance of the PersistenceCapable.
 void ejbActivate()
          From section 16.2.1 of the JDO 1.0 specification: The ejbActivate method acquires a PersistenceManager from the ConnectionFactory, and finds the JDO instance with the specific primary key by calling getObjectById on the PersistenceManager instance.
 java.lang.Object ejbCreate()
          From section 16.2.1 of the JDO 1.0 specification: The ejbCreate method creates a new instance of the corresponding JDO class corresponding to the primary key value, sets the jdoInstance variable, and calls makePersistent with the instance as a parameter.
 java.lang.Object ejbFindByPrimaryKey(java.lang.Object pk)
          Locate an instanced based on the Primary Key.
 java.util.Collection ejbFindByQuery(java.lang.String queryString)
          Find a Collection of the persistent instances based on the JDOQL query.
 void ejbLoad()
          From section 16.2.1 of the JDO 1.0 specification: The ejbLoad and ejbStore methods are used to acquire and close the PersistenceManager.
 void ejbLog(java.lang.String msg, java.lang.Throwable t, java.io.PrintWriter logWriter)
          Allows the implementor to log messages.
 void ejbPassivate()
          From section 16.2.1 of the JDO 1.0 specification: The ejbPassivate method sets the jdoInstance to null and closes the PersistenceManager.
 void ejbPostCreate()
          From section 16.2.1 of the JDO 1.0 specification: An ejbPostCreate method is required for each ejbCreate method.
 void ejbRemove()
          From section 16.2.1 of the JDO 1.0 specification: The ejbRemove method calls deletePersistent with the JDO instance as a parameter.
 void ejbStore()
           
 java.io.Serializable getPersistenceCapableInstance()
          Return the wrapped PersistenceCapable object for this bean instance.
abstract  java.lang.Class getPersistentClass()
          Return the underlying JDO PC class that is being wrapped.
 void setEntityContext(javax.ejb.EntityContext ctx)
          From section 16.2.1 of the JDO 1.0 specification: The setEntityContext method copies the value of the EntityContext parameter to the instance variable entityContext,looksupthe ConnectionFactory using JNDI, and sets it into the persistenceManagerFactory variable.
 void unsetEntityContext()
          From section 16.2.1 of the JDO 1.0 specification: The unsetEntityContext method clears the entityContext variable and the persistenceManagerFactory variable.
 
Methods inherited from class com.solarmetric.rd.kodo.ee.JDOBean
bindConnectionFactory, ejbException, ejbLog, getById, getConnectionFactory, getConnectionFactory, getContext, getJNDIName, getPersistenceManager, lookup, lookupConnectionFactory, setConnectionFactory, setLogWriter, setPropertiesResource, unsetConnectionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ctx

protected javax.ejb.EntityContext ctx
Constructor Detail

JDOEntityBean

public JDOEntityBean()
Method Detail

getPersistentClass

public abstract java.lang.Class getPersistentClass()
Return the underlying JDO PC class that is being wrapped.


createPersistent

public java.lang.Object createPersistent()
                                  throws java.lang.InstantiationException,
                                         java.lang.IllegalAccessException
Create a new instance of the PersistenceCapable. This should be overridden to assign a primary key if the PC uses application identity.

java.lang.InstantiationException
java.lang.IllegalAccessException

getPersistenceCapableInstance

public java.io.Serializable getPersistenceCapableInstance()
Return the wrapped PersistenceCapable object for this bean instance. Note that this assumes that the wrapped PC implements java.io.Serializable.


ejbCreate

public java.lang.Object ejbCreate()
                           throws javax.ejb.EJBException,
                                  java.rmi.RemoteException
From section 16.2.1 of the JDO 1.0 specification: The ejbCreate method creates a new instance of the corresponding JDO class corresponding to the primary key value, sets the jdoInstance variable, and calls makePersistent with the instance as a parameter.

Returns:
the primary key of the created instance
javax.ejb.EJBException
java.rmi.RemoteException

ejbPostCreate

public void ejbPostCreate()
                   throws javax.ejb.EJBException,
                          java.rmi.RemoteException
From section 16.2.1 of the JDO 1.0 specification: An ejbPostCreate method is required for each ejbCreate method. This method does nothing with the wrapped PC.

javax.ejb.EJBException
java.rmi.RemoteException

ejbActivate

public void ejbActivate()
                 throws javax.ejb.EJBException,
                        java.rmi.RemoteException
From section 16.2.1 of the JDO 1.0 specification: The ejbActivate method acquires a PersistenceManager from the ConnectionFactory, and finds the JDO instance with the specific primary key by calling getObjectById on the PersistenceManager instance.

Specified by:
ejbActivate in interface javax.ejb.EntityBean
javax.ejb.EJBException
java.rmi.RemoteException

ejbPassivate

public void ejbPassivate()
                  throws javax.ejb.EJBException,
                         java.rmi.RemoteException
From section 16.2.1 of the JDO 1.0 specification: The ejbPassivate method sets the jdoInstance to null and closes the PersistenceManager.

Specified by:
ejbPassivate in interface javax.ejb.EntityBean
javax.ejb.EJBException
java.rmi.RemoteException

ejbRemove

public void ejbRemove()
               throws javax.ejb.EJBException,
                      java.rmi.RemoteException
From section 16.2.1 of the JDO 1.0 specification: The ejbRemove method calls deletePersistent with the JDO instance as a parameter.

Specified by:
ejbRemove in interface javax.ejb.EntityBean
javax.ejb.EJBException
java.rmi.RemoteException

ejbLoad

public void ejbLoad()
             throws javax.ejb.EJBException,
                    java.rmi.RemoteException
From section 16.2.1 of the JDO 1.0 specification: The ejbLoad and ejbStore methods are used to acquire and close the PersistenceManager. Business methods operating on the JDO instance will access fields which will transparently cause the appropriate state transitions of the persistent instance. The state of the JDO instances will be synchronized with the datastore during transaction completion.

Specified by:
ejbLoad in interface javax.ejb.EntityBean
javax.ejb.EJBException
java.rmi.RemoteException

ejbStore

public void ejbStore()
              throws javax.ejb.EJBException,
                     java.rmi.RemoteException
Specified by:
ejbStore in interface javax.ejb.EntityBean
javax.ejb.EJBException
java.rmi.RemoteException

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
                      throws javax.ejb.EJBException
From section 16.2.1 of the JDO 1.0 specification: The setEntityContext method copies the value of the EntityContext parameter to the instance variable entityContext,looksupthe ConnectionFactory using JNDI, and sets it into the persistenceManagerFactory variable.

Specified by:
setEntityContext in interface javax.ejb.EntityBean
javax.ejb.EJBException

unsetEntityContext

public void unsetEntityContext()
                        throws javax.ejb.EJBException,
                               java.rmi.RemoteException
From section 16.2.1 of the JDO 1.0 specification: The unsetEntityContext method clears the entityContext variable and the persistenceManagerFactory variable.

Specified by:
unsetEntityContext in interface javax.ejb.EntityBean
javax.ejb.EJBException
java.rmi.RemoteException

ejbFindByPrimaryKey

public java.lang.Object ejbFindByPrimaryKey(java.lang.Object pk)
                                     throws javax.ejb.ObjectNotFoundException,
                                            javax.ejb.FinderException
Locate an instanced based on the Primary Key.

Returns:
the JDO object ID of the instance
javax.ejb.ObjectNotFoundException
javax.ejb.FinderException

ejbFindByQuery

public java.util.Collection ejbFindByQuery(java.lang.String queryString)
                                    throws javax.ejb.FinderException
Find a Collection of the persistent instances based on the JDOQL query.

Returns:
a collection of primary key objects of the found instances
javax.ejb.FinderException

ejbLog

public void ejbLog(java.lang.String msg,
                   java.lang.Throwable t,
                   java.io.PrintWriter logWriter)
Description copied from class: JDOBean
Allows the implementor to log messages.

Specified by:
ejbLog in class JDOBean

SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

Copyright 2001,2002,2003 SolarMetric, Inc. All Rights Reserved.