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;publicclassClientCustomisations{@Qualifier(SP_QUALIFIER__CUSTOMISATIONS)@Bean("CustomConfigurations")public Consumer<IDatastoreConfigurator>customStore(){return ClientCustomisations::customizations;}publicstaticvoidcustomizations(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.