|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.p13n.property.AbstractConfigurableEntity | +--com.bea.p13n.property.ConfigurableEntityImpl | +--com.bea.p13n.property.HierarchicalEntityImpl
HierarchicalEntity extends ConfigurableEntity by describing an interface by which Entities can be included in a hierachy of successors. The resulting hierarchy is searched upward when getting Properties. This design pattern models the Chain of Responsibility Pattern (Gamma et al).
For example, if an entity A has a successor entity B, and A is queried for a property but does not have a value persisted for that property, it will lookup entity B and query it for that property.
Also, "explicit" successors can be specified as part of a getProperty method call. These are other ConfigurableEntities that should be queried after the current entity, but before any persisted successors.
A HierarchicalEntity can have one successor persisted for each property set, as well as a "default" successor that is not associated with a property set. The default successor will be queried in the case that the current entity does not have a value, the explicit successor (if one is specified) does not have a value, and the successor for the property's property set does not have a value.
Field Summary | |
protected static java.lang.String |
FIND_BY_PK
finder method name |
Fields inherited from class com.bea.p13n.property.ConfigurableEntityImpl |
_ctx,
_environmentNamingContext,
COMMERCE_POOL,
ENTITY_PROPERTY_MANAGER,
entityPropertyManager,
JNDI_NAME,
PROPERTY_SET_MANAGER,
PROPERTY_SET_TYPE,
propertyLocator,
psManager,
textFormatter,
uid |
Fields inherited from class com.bea.p13n.property.AbstractConfigurableEntity |
CE_METHOD_CACHE,
instanceClass,
PREFIX_GET,
PREFIX_SET,
propertyCache,
textFormatter |
Constructor Summary | |
HierarchicalEntityImpl()
|
Method Summary | |
protected java.lang.reflect.Method |
getFindByPrimaryKey(java.lang.Class homeClass,
java.lang.Class[] params)
Get the findByPrimaryKey method from a home interface. |
protected java.lang.Object |
getImplicitProperty(java.lang.String propertySet,
java.lang.String propertyName)
Override ConfigurableEntity.getImplicitProperty to do a successor search if the property was not found in this entity |
protected java.lang.Object |
getImplicitProperty(java.lang.String propertySet,
java.lang.String propertyName,
ConfigurableEntity explicitSuccessor)
Search for the property value in the default database tables; first in the current entity, then in the explicit successor entity, then in the implicit successor for the property set, and finally in the default implicit successor for this entity. |
java.lang.Object |
getProperty(java.lang.String propertySet,
java.lang.String propertyName,
ConfigurableEntity successor)
Retrieve the value associated with the named key in the specified property set. |
java.lang.String |
getPropertyAsString(java.lang.String propertySet,
java.lang.String propertyName,
ConfigurableEntity successor)
Convenience method to return the property as a String. |
java.lang.Object |
getPropertyNoDefault(java.lang.String propertySet,
java.lang.String propertyName,
ConfigurableEntity successor)
Retrieve the value associated with the property in the specified property set, but does not return a default value from the property's PropertyDefinition if the property does not exist for the entity or in the hierarchy of successors. |
ConfigurableEntity |
getSuccessor(java.lang.String propertySet)
Retrieve the successor associated with this ConfigurableEntity for the specified property set. |
protected ConfigurableEntity |
getSuccessorFromId(java.lang.Long anEntityId)
Get the entity represented by a unique entity id. |
void |
removeSuccessor(java.lang.String propertySet)
Remove the successor for the specified propertySet. |
void |
setSuccessor(java.lang.String propertySet,
ConfigurableEntity successor)
This sets the successor for this object. |
Methods inherited from class com.bea.p13n.property.AbstractConfigurableEntity |
createMapKey,
getCachedProperty,
getExplicitProperty,
getExplicitSetter,
getPropertyAsString,
getPropertyNoDefault,
hasExplicitGetter,
hasExplicitSetter,
removeExplicitProperty,
setExplicitProperty,
upcaseFirst |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected static final java.lang.String FIND_BY_PK
Constructor Detail |
public HierarchicalEntityImpl()
Method Detail |
public java.lang.Object getProperty(java.lang.String propertySet, java.lang.String propertyName, ConfigurableEntity successor) throws java.rmi.RemoteException
propertySet
- The name of the property setpropertyName
- The name of the property to retrieve.successor
- The explicit successor to use for sucessor hiearchy
search if the entity does not have the property defined.public java.lang.String getPropertyAsString(java.lang.String propertySet, java.lang.String propertyName, ConfigurableEntity successor) throws java.rmi.RemoteException
propertySet
- The name of the property setpropertyName
- The name of the property to retrieve.successor
- The explicit successor to use for sucessor hiearchy
search if the entity does not have the property defined.public java.lang.Object getPropertyNoDefault(java.lang.String propertySet, java.lang.String propertyName, ConfigurableEntity successor) throws java.rmi.RemoteException
propertySet
- The name of the property setpropertyName
- The name of the property to retrieve.successor
- The explicit successor to use for sucessor hiearchy
search if the entity does not have the property defined.protected java.lang.Object getImplicitProperty(java.lang.String propertySet, java.lang.String propertyName) throws java.rmi.RemoteException
propertySet
- The name of the property setpropertyName
- The name of the property to retrieve.protected java.lang.Object getImplicitProperty(java.lang.String propertySet, java.lang.String propertyName, ConfigurableEntity explicitSuccessor) throws java.rmi.RemoteException
propertySet
- The name of the property setpropertyName
- The name of the property to retrieve.explicitSuccessor
- The explicit successor to use for sucessor hiearchy
search if the entity does not have the property defined.public void removeSuccessor(java.lang.String propertySet)
public void setSuccessor(java.lang.String propertySet, ConfigurableEntity successor)
successor
- public ConfigurableEntity getSuccessor(java.lang.String propertySet) throws java.rmi.RemoteException
propertySet
- the property set to look inprotected ConfigurableEntity getSuccessorFromId(java.lang.Long anEntityId) throws java.rmi.RemoteException
anEntityId
- the successor's unique entity idprotected java.lang.reflect.Method getFindByPrimaryKey(java.lang.Class homeClass, java.lang.Class[] params)
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |