Documentation Index
Fetch the complete documentation index at: https://docs.activeviam.com/llms.txt
Use this file to discover all available pages before exploring further.
Configuration
Atoti Limits provides a set of services that allow you to manage objects that exist within the application at runtime.Managed objects
Atoti Limits manages three types of objects: These objects may be loaded from an external database, where they can be managed from within Atoti Limits and any changes will be propagated to the external database of choice. To work with persistent data in Atoti Limits, you need to specify the load mode and configure the connection to the external datasource.Prerequisite: Install the database driver
To use your database, add any relevant drivers to yourpom.xml and configure connection properties in your
application.yml. For example, for PostgreSQL this might look as follows:
1. Specify the load mode
You can specify one of three modes when loading data into Atoti Limits:CSVPERSISTENTCSV_TO_PERSISTENT
CSV load mode
This is the default load mode for Atoti Limits. In this mode, data is loaded from CSV files, similar to previous versions of Atoti Limits. You don’t need to configure the external datasource in this mode. You don’t need to explicitly enable this mode, however it can be done so by setting the propertylimits.data.mode=csv.
Persistent load mode
This is the load mode required to work with persistent data in Atoti Limits. In this mode, data is loaded from an external database using JPA (Java Persistence API), specifically Spring’s Data JPA. To use this load mode:- Enable it by setting the property
limits.data.mode=persistent - Configure the external datasource
2. Configure the external datasource
Generate the DDLs
To generate the DDL (Data Definition Language) for any of the datasources, use Spring properties. For example, to generate the DDLs for thelimits-application datasource, you can set the following properties:
create-limits.sql and drop-limits.sql,
in the root directory of the server project. If you are not using Liquibase, the DDL can then be used
to create your database.
Configure the connection to the external datasource
The connection to an external datasource is configured using properties. The default properties are as follows:- The properties are prefixed by
limits.application.datasource. This follows the Spring Boot convention for configuring datasources and is what we expect when the datasources are configured inLimitsJpaConfig.java. - The
urlproperty specifies the JDBC URL for the database. In this case, we are using an in-memory H2 database namedlimits-application.
- The
hibernate.hbm2ddl.autoproperty specifies the behavior of the database schema. In this case, we are usingupdate, which means that the schema will be updated based on the entities in the application.
- The
globally_quoted_identifiersproperty is set totrue. This is to escape reserved keywords in the database when defining columns. For example, the LimitStructure fieldgroupwill be mapped to the column namegroup, which is a reserved keyword in H2, so we delegate to Hibernate to escape.