Skip to main content

Overview

This section explains how to customize the cube’s schema. You can add, remove, or modify fields from new or default stores by creating specific Beans and importing them into LimitsAppConfig.class.
Any customizations to the default schema may cause issues with the default cube configuration.

Customize the schema selection

1. (Optional) Modify the schema selection description

If the field we want to turn into a level is not currently in our schema selection, we need to add it first. To see an example of adding a new store and reference to the schema, see Adding new stores and references.
The cube selection is created by retrieving all fields from a datastore, so adding an extra field to an existing store will also add it to the selection. Only fields in new datastores need a change on the selection.
You can add fields to the schema selection by creating a Spring Bean with type UnaryOperator<CanUseOtherReference>. For example:
Depending on the new store being added, fields may need to be excluded from the selection to avoid a conflict.

2. Add new dimensions, hierarchies, and levels

You can now turn the field in the schema selection into a level in the cube. Dimensions, hierarchies, and levels can be added to the cube configuration by creating Spring Beans with type DimensionsAdder. For example:
The order has been set to 50 so that this dimension is added after the existing dimensions (order=20) and before the epoch dimension (order=99).

Other datastore customizations

To add a new store and reference to the schema, create a Spring Bean with type List<DatastoreConfiguratorSetup.DatastoreConfiguratorConsumer>. This Spring Bean will contain all customizations we want to apply to the datastore. The example below contains the following customizations:
  • Adding a new store and reference to the schema
  • Adding a field to the default store
  • Removing a field from the default store
  • Updating a field from the default store

3. Import the Spring Bean

Once the bean is created, import it into the project. See Importing Spring Beans into the Project on how to do this. Once done, Spring will use the custom bean when configuring the schema.