Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

SQL repository implementation uses Hibernate 5 as persistence framework. For connection pool management we're using HikariCP.

Configuration

todo

...

Repository component configuration is placed in main config.xml file in midpoint.home folder. Basic configuration is quite simple. It will use embedded H2 database which will be placed in midpoint.home folder.

Code Block
xml
xml
<configuration>
  <midpoint>
  <repository>
     <repositoryServiceFactoryClass>com.evolveum.midpoint.repo.sql.SqlRepositoryFactory</repositoryServiceFactoryClass>
     <baseDir>${midpoint.home}</baseDir>
  </repository>
  </midpoint>
</configuration>

For more complex configurations using different DB vendors see Repository Configuration.

DB tables, structures

todo

General

...

Overall code description

todo

 

  • SqlRepositoryBeanConfig - spring wiring and initialization

  • SqlRepositoryConfiguration - sql repository configuration, handles config.xml and such

  • DataSourceFactory - connection pool initialisation and configuration

 

======

Database layout

Our data objects defined in common-3.xsd schema which are managed by SQL repository are quite complex XML objects. Every XML object type is broken to smaller parts to create indexable and non indexable values (columns for them). Some parts of object are still saved as XML fragments (e.g. PasswordType).

...

SQL repository contains com.evolveum.midpoint.repo.sql.query2.QueryInterpreter2 which can interpret queries defined by query-3 schema. Currently supported query filters are equal, substring, and, or, not. QueryInterpreter uses QueryRegistry to translate queried value name to real hibernate entity property name. QueryRegistry loads entity and attribute definitions during initialization.

Configuration

Actual configuration used by SQL repository is placed in main configuration file config.xml in midpoint.home folder. Basic configuration is simple. It will use embedded H2 database which will be placed in midpoint.home folder.

...

<configuration>
  <midpoint>
  <repository>
     <repositoryServiceFactoryClass>com.evolveum.midpoint.repo.sql.SqlRepositoryFactory</repositoryServiceFactoryClass>
     <baseDir>${midpoint.home}</baseDir>
  </repository>
  </midpoint>
</configuration>

For more complex installations see Repository Configuration.

Advanced customization

  • SqlRepositoryBeanConfig - spring wiring and initialization

  • SqlRepositoryConfiguration - sql repository configuration, handles config.xml and such

  • DataSourceFactory - connection pool initialisation and configuration