com.univocity.api.config.builders.ExclusionWithMetadata Maven / Gradle / Ivy
/*******************************************************************************
* Copyright (c) 2014 uniVocity Software Pty Ltd. All rights reserved.
* This file is subject to the terms and conditions defined in file
* 'LICENSE.txt', which is part of this source code package.
******************************************************************************/
package com.univocity.api.config.builders;
import com.univocity.api.config.*;
import com.univocity.api.data.*;
import com.univocity.api.engine.*;
/**
* The ExclusionWithMetadata
configuration is obtained from a {@link PersistenceSetup} using {@link PersistenceSetup#usingMetadata()}.
*
* It is used to define how the {@link DataIntegrationEngine} should delete records in the destination entity of a {@link EntityMapping}
* when executing a data mapping cycle.
*
* @see EntityMapping
* @see PersistenceSetup
* @see DataIntegrationEngine
* @see MetadataSettings
*
* @author uniVocity Software Pty Ltd - [email protected]
*
*/
public interface ExclusionWithMetadata extends ExclusionWithoutMetadata {
/**
* Configures the {@link EntityMapping} to delete all records stored in the destination entity, including those flagged as disabled for updates (using {@link DataIntegrationEngine#disableUpdateOnRecords(String, Dataset)}).
*
*
All metadata records associated with the destination entity will also be removed.
*
* @return the next step of this configuration: determine how to insert records in the destination entity
*/
@Override
public InsertionConfig deleteAll();
/**
* Configures the {@link EntityMapping} to remove records from the destination entity when the source record no longer exists.
*
*
This depends on metadata:
*
* - A data mapping cycle will be executed by the {@link DataIntegrationEngine} and in the first execution,
* the identifiers of the source entity will be stored in the metadata, associated with the identifiers of each row mapped in the destination.
* - When a second mapping cycle is executed, the identifiers of the source entity that are in the metadata, but not in the entity itself, will be obtained.
* - With this information, uniVocity will get the identifiers in the destination entity that will be deleted, and these rows will be removed.
*
*
* Note: This only affects those records that have not been flagged as disabled for updates using {@link DataIntegrationEngine#disableUpdateOnRecords(String, Dataset)}.
*
* @return the next step of this configuration: determine how to update records in the destination entity.
*/
public UpdateWithMetadata deleteAbsent();
/**
* Configures the {@link EntityMapping} to keep all records stored in the destination entity.
* @return the next step of this configuration: determine how to update records in the destination entity.
*/
@Override
public UpdateWithMetadata deleteDisabled();
}