Entity Class Editor

The Axon Ivy Entity Class editor lets you configure the process data objects of Axon Ivy similar to the Data Class Editor. The process data is the data that “flows” through your processes. An Entity Class has additional information about where and how to store the data of a class and its attributes in a relational database.

Use this editor to add new data fields to your Entity Class, to change the type of a field or to document your Entity Class or Entity Class Fields.

Accessibility

Axon Ivy Project Tree > double click on an Entity Class entry in the tree

New > Entity Class > then the editor opens if the class was created successfully

Features

Section Class Comment

Enter your text here to describe in prose what kind of data your Entity Class represents.

Section Attributes

Enter a list of attributes into the table. Use the image0 icon to add a new attribute or just click on the next empty cell in the “Name” column of the table.

If you want to reorder your entries in the table, then you can use the image1 icons to do so. The order influences just the presentation and has no logical implication.

Use the image2 icon to toggle the value change breakpoint for the currently selected attribute. The attribute icon image3 shows that a breakpoint is installed on an attribute. More information about value change breakpoints can be found in the chapter Breakpoints.

Name

Enter the name of your attribute. The name should not contain any special characters or spaces.

Tip

You may already specify the type of the attribute here by adding a colon ‘:’ to the attribute name, followed by desired type (e.g. myDateAttribute:Date). When only adding a colon to the name without a type, the data type selection dialog will appear.

image4

Type

Enter the type of the attribute (fully qualified) or press the image5 to bring up the Data Type Browser.

DB Field

The name of the field in the database table of this attribute. If you generate the database from this Entity Class for this attribute the DB field name is used as a database table column. (Only letters A-Z, digits 0-9 and the bottom bar “_” are supported characters).

Persistent

Decide if the data should be saved in the database if you use the persistence API as well as if the data should be persistent between a task switch. If the data is not set to be persistent, then you lose all information if the execution of the process passes a task switch process element.

Length

You can specify the length of the field in the database. This can only be specified if the type is a String, BigDecimal, or BigInteger. The default length for string fields is 255 and for decimal fields 19,2 on the database. Changing the length has only an effect if the database schema is recreated.

Properties
id

Specifies the primary key field of an entity. Every Entity Class must have exactly one primary key.

generated

Specifies if the primary key should be generated automatically.

not nullable

Whether the database column is not nullable.

unique

Whether the field should be a unique key in the database.

not updateable

Whether the column is not included in SQL UPDATE statements generated by the persistence provider.

not insertable

Whether the column is not included in SQL INSERT statements generated by the persistence provider.

version

Specifies the version field of an entity that serves as its optimistic lock value. The version is used to ensure integrity when performing the merge operation.

Association

Defines the association to another Entity Class. The actual configuration is done in the embedded Association Editor.

Comment

Describe the means of your attribute here.

Association Editor

Defines the association to another Entity Class and are only allowed to them and not other types of classes.

image6

Association

ONE_TO_ONE

Defines a one-to-one (1:1 on the database) association with another Entity Class. Use only if the type of the attribute is an Entity Class.

MANY_TO_ONE

Defines a many-to-one (n:1 on the database) association to another Entity Class. Use only if the type of the attribute is a List or Set of an Entity Class. The inverse association of a MANY_TO_ONE is an ONE_TO_MANY association.

ONE_TO_MANY

Defines a one-to-many (1:n on the database) association to another Entity Class. Use only if the type of the attribute is a List or Set of an Entity Class. This type of association always needs a mapped-by specification because this is always the inverse side of a MANY_TO_ONE association.

Cascade

Defines the cascadable operations which are propagated to the associated Entity. E.g., if persist is enabled, the associated object will be persisted automatically if an instance of this class is persisted.

persist

If enabled, the associated object is persisted automatically if an instance of the class is persisted. See persist operation.

merge

If enabled, the associated object is merged automatically if an instance of the class is merged. See merge operation.

remove

If enabled, the associated object is removed automatically if an instance of the class is removed. See remove operation.

refresh

If enabled, the associated object is refreshed automatically if an instance of the class is refreshed. See refresh operation.

Mapped by

The field that owns the relationship on the specified type that must be an Entity Class. This element is only specified on the inverse (non-owning) side of the association. Mapped by can only be used for ONE_TO_ONE and ONE_TO_MANY associations. The inverse side of the association must be also the inverse association (ONE_TO_ONE inverse ONE_TO_ONE, ONE_TO_MANY inverse MANY_TO_ONE)

Orphans

If orphans removal is enabled and an entity that is the target of a relationship is removed from the relationship (either by removal from the collection or by setting the relationship to null), the orphaned entity will be removed. If the orphaned entity is a detached, new, or removed entity, the semantics do not apply.

If orphan removal is enabled and the remove operation is applied to the source entity the remove operation will be propagated as defined in the cascade section.

The remove operation is applied at the time of the flush operation. The orphans removal functionality is intended for entities that are privately “owned” by their parent entity.

Example:

A ‘Basket’ entity holds a list of ‘Product’ entities. What happens if basket.getProducts().remove(..) is called?

  • orphan removal enabled: the product is removed from the list of referenced products even if the entity is reloaded or refreshed.

  • orphan removal disabled: the product stays in the list of referenced products if the entity is reloaded or refreshed.