«Persistent Object»

Stereotype «PersistentObject» can be used to define all information needed to map a class to a relational database using Java Persistence API (JPA).

Stereotype

PersistentObject

Applicable Elements

Class

Tagged Values

Name

Type

Description

classID

Integer

The classID is a global ID for persistent objects. It is used e.g. for mapping of inheritance hierarchies to databases in object relational mapping. The classID is maintained and managed manually and must be unique within the whole UML model.

JEAF Generator will check and ensure it’s uniqueness and will produce an error if this constraint is not met. It’s recommended to work with value ranges for for Class-IDs if your model becomes a little larger.

table

String

Attribute defines the name of the table that is used to store objects of this class in a database. If the attribute is not set then the no qualified name of the class in upper case letters will be used.

Please be aware of specific length and keyword restrictions depending on the used relational database.

optimisticLock

boolean

Attribute defines the locking behavior of the class. If the attribute is set to false then no locking will be used. In case of true optimistic locking is enabled.

Default value is true.

OIDRowName

String

Optional attribute can be used to define the name of the row that is used to store the so called Object-ID. The Object-ID is the object oriented equivalent to a primary key on the database.

If the attribute is not set then the globally configured default value of JEAF Generator is used.

VersionLabelRowName

String

Optional attribute can be used to define the name of the row that is used as version label for optimistic locking.

If the attribute is not set then the globally configured default value of JEAF Generator is used.

 

For further information please refer to: