«Object Mapping»

JEAF Generator offers the possibility to unburden developers from error-prawn and boring job of mapping objects from one into another. To do so a so called object mapping can be defined in the UML model by defining dependencies between attributes using stereotype «ObjectMapping». Object mappings distinguish between creating, updating and reading of objects. As you will see below behavior of an object mapping can be defined for each of the cases. Besides attributes it’s also possible that operations are the source or target of an object mapping. Please see the explanation below on the cases when usage of operations as source and / or target is supported.

 

Object mapping between associations are not supported as this may cause heavy performance issues (aka n+1 select problem in ORM).

Stereotype

ObjectMapping

Applicable Elements

Dependency

Tagged Values

Name

Type

Description

onCreate

boolean

Attribute defines the behavior of the object mapping in case that a new target object is created based on the defined source object (e.g. a service object is used to create a persistent object).

If tagged value is set to true then the source value will be used when the target object is created.

Default value is of the tagged value true. Operations are not supported as target of the dependency if this tagged value is set to true.

onUpdate

boolean

Attribute defines the behavior of the object mapping in case that a target object is updated based on the defined source object (e.g. a service object is used to update a persistent object).

If tagged value is set to true then the source value will be used when the target object is updated.

Default value is of the tagged value true. Operations are not supported as target of the dependency if this tagged value is set to true.

onRead

boolean

Attribute defines the behavior of the object mapping in case that a source object is created based on the defined target object (e.g. a persistent object is used to create a service object).

If tagged value is set to true then the target value will be used when the source object is created.

Default value is of the tagged value true. Parameterless operations can be used as target of the dependency.

 

For further information please refer to: