Entity Services
Dynamic attributes and entity services are stored and shared in the same complex attribute of the service. The relation between the data objects of the entity and dynamic attributes are maintained as a unidirectional one-to-many relationship in JDO so that simple object navigation from the entity to the dynamic attributes is possible. No typed access (setter and getter) methods for this complex attribute are created.
The dynamic attributes can only be accessed through the untyped setProperty and getProperty methods of the data object entity. The returned attribute value is the attribute value of the DynamicAttribute where the attribute name needs to resolved in the data object of the entity.
So that the dynamic attributes can pass through an application service, the persistent-capable data object used to store the data in the database needs to be detached from the persistence manager. The read and query operations must also be attached to the persistence manager in the create, update and delete operation.
As JDO1.0 does not support detaching and attaching a PC class either from or to a persistence manager, this functionality must be implemented inside the entity services lifecycle methods. Therefore, a non-PC clone of the PC class instance needs to created during the lifecycle methods.
The following figure describes the relationship between the services, data objects, and dynamic attributes. It indicates the uses and attachment and detachment properties between services and data object and data structure and dynamic attributes. It is a simplified version of a more detailed object model.
