MySQLInsertEntityProperties#
- public class MySQLInsertEntityProperties extends MySQLTransaction implements InsertEntityPropertiesImpl#
Insert the entity’s properties.
This implementation transforms a deep tree of properties into a flat representation. This transformation is a MySQL-backend implementation detail and should not be leaked to the clients.
The reverse transformation happens in MySQLRetrieveProperties.
- Author:
Timm Fitschen
For basic information on the kind of mapping that is done here, please refer to the documentation (Development/Structure of the Java Code/Mapping of Objects to Database Tables)
How it works: In order to represent Properties that have no row-like representation in the data tables of MariaDB replacement helper objects are used (@see
ReplacedProperty). When ever a Property cannot be represented directly, it is replaced by a replacement. Every replacement gets an ID that is unique for this entity, i.e. no two replacements that are needed to represent all properties of a given entity have the same ID.Properties are added in two different ways/stages:
directly in the scope of the main entity (domain_id=main_entity_domain, entity_id=main_entity_id) 2. in the scope of the replacement property (domain_id=main_entity_id, entity_id=replacement_id)
All properties that have subproperties (non leaf nodes in the property tree) are inserted in stage 1. All leaf properties that are not direct properties of the main entity are inserted in stage 2.
The assignment of subproperties to parent properties can be done due to the replacement as part of stage 2 (domain_id=main_entity_id, entity_id=replacement_id).
See also:
{@linkMySQLRetrieveProperties}
Fields#
STMT_INSERT_ENTITY_PROPERTY#
STMT_REGISTER_SUBDOMAIN#
Constructors#
MySQLInsertEntityProperties#
Methods#
execute#
- public void execute(EntityInterface entity)#