Serialization

Relations and Identities

Entities can be related to each other in various ways. The import/export API provides a simple and consistent system to identify and change related entities.

1 : N relations

If two entities are related to each other via a 1:N relationship you can change the relationship only via the child entity.

To change an entity reference, you specify an ID property of the new entity via the path notation (PROPERTYNAME< dot> ID_PROPERTY).

Object Identity

Each entity can be uniquely identified in three different ways:

When you import an entity you have to specify which property you want to use to identify the entity. If an entity with the given ID is found, it is updated with the provided date. If no entity is found with the given ID it is inserted.

Note: When importing entities with a system_id property, you do not have to explicitly mark it as identity property.

How to specify the identity property depends on the format:

If more than one property is specified, the first applicable identity property is used.

Note: All Identity values belonging to the same group must be set together. To get for example, a package, you can specify either (id) or name.

Get Deployment Package by id, update name

<Entity mainType="Package"> <Property name=”system_id” isIdentity=”true”> <Value>123</Value> </Property> <Property name=”system_name”> <Value>new name</Value> </Property> </Entity>

N to M relations

N to M relations are described via their own main types. These simple main types have two system properties which point to the related entities. You specify a related entity via the dot notation as with 1:n relations.