Organizing Datastore Helper Customizations into a Separate Class

This page provides a description of how to keep Datastore Helper customizations better organized.

Step 1 - Create our class

The customizations defined here will be wired via the qualifier SP_QUALIFIER__CUSTOMISATIONS into the DatastoreCustomisationsConfig.addModifications method, and can help us keep things tidy.

package com.activeviam.frtb.starter.cfg.impl;

import static com.activeviam.frtb.core.constants.FRTBConstants.SP_QUALIFIER__CUSTOMISATIONS;

import java.util.function.Consumer;

import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;

import com.activeviam.tools.datastore.IDatastoreConfigurator;

public class ClientCustomisations {

	@Qualifier(SP_QUALIFIER__CUSTOMISATIONS)
	@Bean("CustomConfigurations")
	public Consumer<IDatastoreConfigurator> customStore() {
		return ClientCustomisations::customizations;
	}

	public static void customizations(IDatastoreConfigurator configurator) {
		// HERE WE CAN HAVE ANY CUSTOMIZATIONS WE PREVIOUSLY HAD IN com.activeviam.frtb.starter.cfg.impl.DatastoreCustomisationsConfig.addModifications
	}
}

Step 2 - Include in FRTBConfig

Navigate to the loading config class FRTBConfig which can be found in frtb-starter/src/main/java/com/activeviam/frtb/starter/cfg/impl/ and ensure that our class is included in the imports.

Suggested further reading

Enriching File Fields by Adding Column Calculators

Adding New Cube Hierarchies

Adding New Cube Measures

Adding New Data Loading or UnloadingTopics

Adding and Loading New Columns to an Existing File