INameMapper is used to convert Datastore field and store names into a format that works with remote databases.
Reference DirectQueryNameMapper
The referenceDirectQueryNameMapper class is responsible for converting names from one format into another. It converts datastore fields or store
names into a name that is more compatible with remote databases. Since some databases have strict naming conventions, the
DirectQueryNameMapper is designed to handle most database naming conventions.
The reference DirectQueryNameMapper works by taking a datastore name and converting it into one with the following logic:
- Entire name is converted to uppercase
- Spaces are replaced with underscores ’_’
- CamelCase is split on the hump with underscores
DirectQueryNameMapper:
Custom naming conventions
To use custom naming conventions, create a custom implementation of theINameMapper interface and mark it as a spring
component using the @Primary annotation so that this implementation takes precedence over the reference DirectQueryNameMapper.
Then import the custom naming convention spring component into the ApplicationConfig (or into the FRTBConfig class).
Custom naming convention example
This example creates a custom naming convention that converts a given name into uppercase and replaces spaces with underscores ’_’. First, create a function that converts one way from the local name to the remote name:CustomNameMapper is created. Use the IDatastoreSchemaDescription to help with the pre-caching.
FRTBConfig class):