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. Additionally an Entity Class has information where and how to store the data of a class and its attributes to 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.
Axon.ivy Project Tree > double click on a Entity Class entry in the tree
New > Entity Class > then the editor opens if the class was created successfully
Section Class Comment
Enter your text here to describe in prose what kind of data your Entity Class represents.
Enter a list of attributes into the table. Use the 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 icons to do so. The order influences just the presentation and has no logic implication.
Use the icon to toggle the value change breakpoint for the currently selected attribute. The attribute icon shows that a breakpoint is installed on a attribute. More information about value change breakpoints can be found in chapter Breakpoints.
Enter the name of your attribute. The name should not contain any special characters or spaces.
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.
Enter the type of the attribute (fully qualified) or press the 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 database field. (Only letters A-Z, digits 0-9 and the bottom bar “_” are supported characters)
Decide if the data should be saved in the database if you use the persistence API and if the data should be persistent between a task switch. If the data is not set to be persistent, then you loose all information if the execution of the process passes a task switch process element.
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. Changes of the length has only an effect if the database schema is created new.
Specifies the primary key field of an entity. Every Entity Class must have exactly one primary key.
Specifies if the primary key should be generated automatically.
- not nullable
Whether the database column is not nullable.
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.
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.
Defines the association to another Entity Class. The actual configuration is done in the embedded Association Editor.
Describe the means of your attribute here.
Defines the association to another Entity Class and are only allowed to them and not other types of classes.
Defines a one to one (1:1 on the database) association to another Entity Class. Can only be used if the type of the attribute is an Entity Class.
Defines a many to one (n:1 on the database) association to another Entity Class. Can only be used if the type of the attribute is a List or Set of an Entity Class. The inverse association of a MANY_TO_ONE is a ONE_TO_MANY association.
Defines a one to many (1:n on the database) association to another Entity Class. Can only be used if the type of the attribute is a List or Set of an Entity Class. This type of association needs always a mapped by specification, because this is always the inverse side of an MANY_TO_ONE association.
Defines the cascadable operations which are propagated to the associated Entity. E.g. if persist is enabled then the associated object will be persisted automatically if an instance of this class is persisted.
If enabled the associated object is persisted automatically if an instance of the class is persisted. See persist operation.
If enabled the associated object is merged automatically if an instance of the class is merged. See merge operation.
If enabled the associated object is removed automatically if an instance of the class is removed. See remove operation.
If enabled the associated object is refreshed automatically if an instance of the class is refreshed. See refresh operation.
The field that owns the relationship on the specified type which 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)
If orphans remove is enabled and an entity that is the target of the relationship is removed from the relationship (either by removal from the collection or by setting the relationship to null), the remove operation will be applied to the entity being orphaned. If the entity being orphaned is a detached, new,or removed entity, the semantics do not apply.
If orphan remove 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.
A ‘Basket’ entity holds a list of ‘Product’ entities. What happens if
basket.getProducts().remove(..) is called?
orphan remove enabled: the product is removed from the list of referenced products even if the entity is reloaded or refreshed.
orphan remove disabled: the product stays in the list of referenced products if the entity is reloaded or refreshed.