|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.primix.vlib.ejb.impl.AbstractEntityBean
Provides basic support for the entity context, empty or minimal implementations of the required methods, and some utilties.
Field Summary | |
protected EntityContext |
context
The EntityContext provided by the application server. |
protected boolean |
dirty
Flag indicating that the object is 'dirty' and needs to be written back to the database. |
Constructor Summary | |
AbstractEntityBean()
|
Method Summary | |
java.lang.Integer |
allocateKey()
Uses the KeyAllocator session bean to allocate a necessary key. |
void |
ejbActivate()
Empty implementation; subclasses may override. |
void |
ejbLoad()
Clears the dirty flag. |
void |
ejbPassivate()
Empty implementation; subclasses may override. |
void |
ejbRemove()
Empty implementation; subclasses may override. |
void |
ejbStore()
Clears the dirty flag. |
protected abstract java.lang.String[] |
getAttributePropertyNames()
Implemented in subclasses to provide a list of property names to be included in the entity attributes map. |
java.util.Map |
getEntityAttributes()
Returns a Map of the properties of the bean. |
protected java.lang.Object |
getEnvironmentObject(java.lang.String name,
java.lang.Class objectClass)
Gets a named object from the bean's environment naming context. |
boolean |
isDirty()
Returns a flag that indicates that the entity must be saved to the database. |
void |
setEntityContext(EntityContext context)
|
void |
unsetEntityContext()
|
void |
updateEntityAttributes(java.util.Map update)
Updates the bean with property changes from the update Map . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected EntityContext context
protected transient boolean dirty
Constructor Detail |
public AbstractEntityBean()
Method Detail |
public void setEntityContext(EntityContext context)
setEntityContext
in interface EntityBean
public void unsetEntityContext()
unsetEntityContext
in interface EntityBean
public boolean isDirty()
protected java.lang.Object getEnvironmentObject(java.lang.String name, java.lang.Class objectClass) throws java.rmi.RemoteException, NamingException
public void ejbActivate() throws EJBException, java.rmi.RemoteException
ejbActivate
in interface EntityBean
public void ejbPassivate() throws EJBException, java.rmi.RemoteException
ejbPassivate
in interface EntityBean
public void ejbRemove() throws EJBException, java.rmi.RemoteException
ejbRemove
in interface EntityBean
public void ejbLoad() throws EJBException, java.rmi.RemoteException
ejbLoad
in interface EntityBean
public void ejbStore() throws EJBException, java.rmi.RemoteException
ejbStore
in interface EntityBean
public java.lang.Integer allocateKey() throws java.rmi.RemoteException
protected abstract java.lang.String[] getAttributePropertyNames()
public java.util.Map getEntityAttributes()
Map
of the properties of the bean. This Map is
returned to the client, where it can be modified and then used to update
the entity bean in a single method
The properties included in the Map are defined by the
getAttributePropertyNames()
method, which is implemented
by concrete subclasses.
public void updateEntityAttributes(java.util.Map update)
Map
.
Only the keys defined by getAttributePropertyNames()
will be
accessed (keys and values that are not in that list are ignored).
The corresponding bean property will only be updated if the key is present ... this means that the update may contain just the changed keys. Remember that a Map may store null values.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |