Data Stores
When a Jmix application is created, the main data store already exists and can be accessed from the Jmix Tool Window.
By double-clicking, you can open the properties dialog of the data store. By default, HSQLDB is set as a database type.
The following properties are available both for the main and additional data stores:
-
Database type - type of the database server. You can select one of the available databases from the list.
-
Database URL - a host, port, and database name.
-
Connection params - other connection parameters. The format of the connection parameters depends on the selected DBMS. The string should include a separator between the database name and parameters. You can use the pencil button in the right part of the Connection params field to enter connection parameters conveniently. In this case, Studio automatically forms the connection string by adding DBMS-specific separator characters.
-
Show raw URL - shows connection parameters as URL.
-
Integrated Security - enables the corresponding authentication option when connecting to the Microsoft SQL Server 2012+ database.
-
-
Database user and Password - database connection credentials.
You can use placeholders of the following type ${VAR:default_value}
where VAR is an environment variable to set database properties.
Studio resolves the placeholders and uses the resulting values for all operations with the database: test connection, recreate, update, Liquibase diff, and so on.
Additional Data Store
To create additional data store, use an action from the context menu. Another way is to select the one from Advanced:
See the description of the database properties common for both the main and additional data stores above.
For the additional data store, specify Data store name and select an option in the DB Schema Management section:
-
Disabled - Studio doesn’t track database schema changes for this data store. This is the default mode.
-
Update Only - provides the Update action and creates Liquibase changelogs.
-
Create and Update - provides the Update and Recreate actions and creates Liquibase scripts.
Data Store Actions
By right-clicking the data store item in the Jmix project tree, you can open its context menu:
Number of actions shown in the menu depends on the data store type and DB schema management mode.
-
New → Additional Data Store - opens the dialog for creating a new data store.
-
Manage Data Store - opens the dialog to edit data store settings.
-
Remove - removes the data store along with all associated configuration files and Liquibase changelogs.
-
Recreate - recreates database belonging to the selected data store. Applicable for the main data store and additional data stores with Create and Update schema management type.
-
Update - updates database schema for the selected data store. Applicable for the main data store and additional data stores with Update Only and Create and Update schema management types.
-
Generate Liquibase Changelog - generates changelog files for the selected data store by comparing data model with the database schema. Applicable for the main data store and additional data stores with Update Only and Create and Update schema management types.
-
Generate Data Model - generates data model from the selected data store.
-
Jump to Source - opens a Spring configuration class.