Our data objects defined in common-3.xsd schema which are managed by SQL repository are quite complex. They are stored in
m_object table in
fullObject column as blobs. Parts of these objects are stored in related tables for better searching.
DB schema version 4.2 (ER diagram extracted with DBeaver from PostgreSQL)
PrismObject represented as XML objects contain one natural primary key - oid attribute. Some objects also contain PrismContainers which use id as container identifier (assignments, inducements, triggers, etc.). Identifiers for objects and containers are generated in midPoint. Object references introduced in XSD schema are transformed to entities with weak reference which means reference doesn't use foreign key to achieve full consistency across midPoint repository. This will simplify work with objects during import or delete as it's not necessary to correctly sort objects before making any changes. To further improve hibernate performance we've introduced
EntityState interface. This interface is used within most entities. Developer knows in most cases whether entity is transient or detached, therefore hibernate doesn't need to do any checks (we'll get rid of many unnecessary select queries).