Interface MasterDataInstanceImportBuilder
- All Known Implementing Classes:
MasterDataInstanceImportBuilderImpl
public interface MasterDataInstanceImportBuilder
An Import Builder which allows importing master data instances in bulk from master data documents.
The documents being imported should have the following format:
Single tenant:
{
"dataObjectDefinitionKey": "country",
"tenantId": "acme",
"masterData": [
{...},
...
]
}
Multi tenants:
{
"dataObjectDefinitionKey": "country",
"tenantIds": [ "acme", "megacorp" ],
"masterData": [
{...},
...
]
}
If the data object definition key or id are provided then the document can also have the following format:
[
{...},
...
]
- Author:
- Filip Hrisafov
-
Method Summary
Modifier and TypeMethodDescriptionaddClasspathResource
(String resource) Adds a master data json file from the classpath to this builder.addInputStream
(String resourceName, InputStream inputStream) Adds a master data json file to this builder.addResourceDocument
(String resourceDocument) Adds a master data json document to this builder.dataObjectDefinitionId
(String dataObjectDefinitionId) The data object definition id that should be used when deploying the master data resource documents.dataObjectDefinitionKey
(String dataObjectDefinitionKey) The data object definition key that should be used when deploying the master data resource documents.doImport()
Before importing master data instances from the document.The tenantId that should be used when deploying the master data resource documents.
-
Method Details
-
addInputStream
Adds a master data json file to this builder. -
addClasspathResource
Adds a master data json file from the classpath to this builder. -
addResourceDocument
Adds a master data json document to this builder. -
tenantId
The tenantId that should be used when deploying the master data resource documents. If set then the tenantId from the document would be ignored.- Parameters:
tenantId
- the id of the tenant to which to deploy
-
dataObjectDefinitionKey
The data object definition key that should be used when deploying the master data resource documents. If set then the dataObjectDefinitionKey from the document would be ignored.- Parameters:
dataObjectDefinitionKey
- the key of the data object that should be used for deployment
-
dataObjectDefinitionId
The data object definition id that should be used when deploying the master data resource documents. If set then the dataObjectDefinitionKey from the document would be ignored.- Parameters:
dataObjectDefinitionId
- the id of the data object that should be used for deployment
-
overwrite
MasterDataInstanceImportBuilder overwrite()Before importing master data instances from the document. Delete all of them that matched the definition id / key in the matching tenant. This should be used with care. If set then the overwrite flag from the document would be ignored. -
doImport
Collection<MasterDataInstance> doImport()
-