BEA Systems, Inc.

com.beasys.commerce.foundation
Class EntityImpl

java.lang.Object
  |
  +--com.beasys.commerce.foundation.EntityImpl
Direct Known Subclasses:
ConfigurableEntityImpl, SchemaImpl

public class EntityImpl
extends java.lang.Object
implements javax.ejb.EntityBean, RelationalReference

This is the base implementation of the Business Smart Component (BSC) entity interface. For each BSC Entity derived interface, there will be a corresponding BSC EntityImpl with business methods that are mirrored. It also provides storage for an EntityContext and an implementation of the Set and Get Entity Context methods.

See Also:

Notes on entity beans "SmartUpdate" for BMP:

Often only a few attributes on a bean will need to be updated into the persistent store. It is desirable to update only these fields, not the entire bean. This is especially true for arbitrarily large TreeMap collections. Theory Center’s entity beans implement a method called getUpdateProperties(). This method returns either null or a hashtable. When the return value is null, the entire bean should be updated into the database. When the return value is a hashtable, it should be interpreted as follows:

For any field that has changed since the last update, there is an entry in the hashtable. For any attribute other than a TreeMap, the key and value are the name of the changed field. The implication for collection attributes other than TreeMaps, is that the entire collection must be removed and updated in the database. The implication for attributes that are belongings or SmartHandles is that the entire attribute must be updated into the database. In these cases, granularity is at the bean-attribute level. When the attribute is a TreeMap, the key is the name of the changed field. The value is another hashtable. The keys in this hashtable are the keys in the TreeMap for any changed entry in the TreeMap. The values in this hashtable are one of the following (case insensitive) strings:

  • INSERT
  • REMOVE
  • UPDATE
This means that the entire row for the entry in the TreeMap with the matching key should be inserted, removed, or updated. Granularity is at the map entry level (e.g. a row in the database). When the environment variable SmartUpdate is set to false, then Smart Updating is turned off. It is the responsibility of the Impl file to implement this.
, Serialized Form

Field Summary
 java.lang.String __classIdentifier
           
 SmartEntityReference __containingEntity
           
 java.lang.Object __mapKey
           
 int __sequenceNumber
           
 javax.ejb.EntityContext _ctx
           
 boolean _isDirty
           
 
Constructor Summary
EntityImpl()
          EntityImpl constructor.
 
Method Summary
 void clearRelationalBinding(java.lang.String attributeIdentifier, java.util.Collection collection)
           
 void clearRelationalBinding(java.lang.String attributeIdentifier, java.util.Collection collection, java.lang.Object o)
           
 void clearRelationalBinding(java.lang.String attributeIdentifier, java.util.Map map)
           
 void clearRelationalBinding(java.lang.String attributeIdentifier, java.util.Map map, java.lang.Object key)
           
 void ejbActivate()
          ejbActivate method.
 SmartKey ejbCreate(SmartKey pk)
          ejbCreate method.
 java.util.Enumeration ejbFindAll()
           
 SmartKey ejbFindByPrimaryKey(SmartKey pk)
           
 void ejbLoad()
          ejbLoad method.
 void ejbPassivate()
          ejbPassivate method.
 void ejbPostCreate(SmartKey key)
          ejbPostCreate method.
 void ejbRemove()
          ejbRemove method.
 void ejbStore()
          ejbStore method.
 java.lang.String get__classIdentifier()
          Get class identifier for this object (used to persist subclasses in a single collection or map)
 Belonging get__containingBelonging()
          Get foreign key information about the bean that contains this object
 javax.ejb.EJBObject get__containingEntity()
          Get foreign key information about the bean that contains this object
 SmartEntityReference get__containingEntityReference()
           
 java.lang.Object get__mapKey()
          get map key
 int get__sequenceNumber()
          Get the sequencer number
 javax.ejb.EntityContext getEntityContext()
          getEntityContext method.
 boolean isModified()
          This method is used by some containers to evaluate if the bean has been modified and it must be persisted.
 void set__containingBelonging(Belonging belonging)
          Provides foreign key information about the bean that contains this object
 void set__containingEntity(javax.ejb.EJBObject containingEntity)
          Provides foreign key information about the bean that contains this object
 void set__containingEntityReference(SmartEntityReference smartEntityReference)
           
 void set__mapKey(java.lang.Object mapKey)
          Provides map key information
 void setEntityContext(javax.ejb.EntityContext ctx)
          setEntityContext method.
 void unsetEntityContext()
          unsetEntityContext method.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_isDirty

public transient boolean _isDirty

_ctx

public javax.ejb.EntityContext _ctx

__containingEntity

public SmartEntityReference __containingEntity

__mapKey

public java.lang.Object __mapKey

__sequenceNumber

public int __sequenceNumber

__classIdentifier

public java.lang.String __classIdentifier
Constructor Detail

EntityImpl

public EntityImpl()
EntityImpl constructor.
Method Detail

ejbActivate

public void ejbActivate()
                 throws java.rmi.RemoteException
ejbActivate method.
Specified by:
ejbActivate in interface javax.ejb.EntityBean

ejbCreate

public SmartKey ejbCreate(SmartKey pk)
                   throws javax.ejb.CreateException,
                          java.rmi.RemoteException
ejbCreate method.

ejbLoad

public void ejbLoad()
             throws java.rmi.RemoteException
ejbLoad method.
Specified by:
ejbLoad in interface javax.ejb.EntityBean

ejbPassivate

public void ejbPassivate()
                  throws java.rmi.RemoteException
ejbPassivate method.
Specified by:
ejbPassivate in interface javax.ejb.EntityBean

ejbPostCreate

public void ejbPostCreate(SmartKey key)
                   throws javax.ejb.CreateException,
                          java.rmi.RemoteException
ejbPostCreate method.

ejbRemove

public void ejbRemove()
               throws java.rmi.RemoteException,
                      javax.ejb.RemoveException
ejbRemove method.
Specified by:
ejbRemove in interface javax.ejb.EntityBean

ejbStore

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

getEntityContext

public javax.ejb.EntityContext getEntityContext()
getEntityContext method.

setEntityContext

public void setEntityContext(javax.ejb.EntityContext ctx)
                      throws java.rmi.RemoteException
setEntityContext method.
Specified by:
setEntityContext in interface javax.ejb.EntityBean

unsetEntityContext

public void unsetEntityContext()
                        throws java.rmi.RemoteException
unsetEntityContext method.
Specified by:
unsetEntityContext in interface javax.ejb.EntityBean

ejbFindByPrimaryKey

public SmartKey ejbFindByPrimaryKey(SmartKey pk)
                             throws javax.ejb.FinderException,
                                    java.rmi.RemoteException

ejbFindAll

public java.util.Enumeration ejbFindAll()
                                 throws javax.ejb.FinderException,
                                        java.rmi.RemoteException

isModified

public boolean isModified()
                   throws java.rmi.RemoteException
This method is used by some containers to evaluate if the bean has been modified and it must be persisted.

get__sequenceNumber

public int get__sequenceNumber()
Get the sequencer number
Specified by:
get__sequenceNumber in interface RelationalReference

get__mapKey

public java.lang.Object get__mapKey()
Description copied from interface: RelationalReference
get map key
Specified by:
get__mapKey in interface RelationalReference
Tags copied from interface: RelationalReference
Returns:
the mak key
Throws:
ClassCastException - source object is not an instance of the remote interface of the containing class.

set__mapKey

public void set__mapKey(java.lang.Object mapKey)
Description copied from interface: RelationalReference
Provides map key information
Specified by:
set__mapKey in interface RelationalReference
Tags copied from interface: RelationalReference
Parameters:
mapKey - the key if this object is used in a map

get__containingEntityReference

public SmartEntityReference get__containingEntityReference()

set__containingEntityReference

public void set__containingEntityReference(SmartEntityReference smartEntityReference)

set__containingEntity

public void set__containingEntity(javax.ejb.EJBObject containingEntity)
Provides foreign key information about the bean that contains this object
Specified by:
set__containingEntity in interface RelationalReference
Parameters:
ejbObject - remote interface of the containing bean
Throws:
ClassCastException - source object is not an instance of %EntityType%

get__containingEntity

public javax.ejb.EJBObject get__containingEntity()
Get foreign key information about the bean that contains this object
Specified by:
get__containingEntity in interface RelationalReference
Returns:
ejbObject remote interface of the containing bean

get__classIdentifier

public java.lang.String get__classIdentifier()
Get class identifier for this object (used to persist subclasses in a single collection or map)
Specified by:
get__classIdentifier in interface RelationalReference
Returns:
class identifier for this object.

set__containingBelonging

public void set__containingBelonging(Belonging belonging)
Provides foreign key information about the bean that contains this object
Specified by:
set__containingBelonging in interface RelationalReference
Parameters:
ejbObject - remote interface of the containing bean

get__containingBelonging

public Belonging get__containingBelonging()
Get foreign key information about the bean that contains this object
Specified by:
get__containingBelonging in interface RelationalReference
Returns:
ejbObject remote interface of the containing bean
Throws:
ClassCastException - source object is not an instance of the remote interface of the containing class.

clearRelationalBinding

public void clearRelationalBinding(java.lang.String attributeIdentifier,
                                   java.util.Collection collection)

clearRelationalBinding

public void clearRelationalBinding(java.lang.String attributeIdentifier,
                                   java.util.Collection collection,
                                   java.lang.Object o)

clearRelationalBinding

public void clearRelationalBinding(java.lang.String attributeIdentifier,
                                   java.util.Map map,
                                   java.lang.Object key)

clearRelationalBinding

public void clearRelationalBinding(java.lang.String attributeIdentifier,
                                   java.util.Map map)

BEA Systems, Inc.

Copyright © 2000 BEA Systems, Inc. All Rights Reserved