All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.univocity.api.engine.EntityMappingContext Maven / Gradle / Ivy

There is a newer version: 1.0.6
Show newest version
/*******************************************************************************
 * 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.engine;

/**
 * The EntityMappingContext is available to {@link RowReader} instances used during the execution of a data mapping between two entities.
 *
 * It provides information specific to the entities being mapped
 *
 * @see RowReader
 * @see RowMappingContext
 * @see EngineExecutionContext
 * @see MappingCycleContext
 *
 * @author uniVocity Software Pty Ltd - [email protected]
 *
 */
public interface EntityMappingContext {

	/**
	 * Returns the name of the source data store whose data entities are being read.
	 * @return the source data store name
	 */
	public String getSourceDataStore();

	/**
	 * Returns the name of the destination data store whose data entities are receiving mapped data.
	 * @return the destination data store name
	 */
	public String getDestinationDataStore();

	/**
	 * Returns the name of the source data entity that is being read
	 * @return the source data entity name
	 */
	public String getSourceEntity();

	/**
	 * Returns the name of the destination data entity that is receiving data mapped from the source entity.
	 * @return the destination data entity name
	 */
	public String getDestinationEntity();

	/**
	 * Skips the mapping between the source and destination entities. Rows mapped (if any) before this method is called will be persisted.
	 */
	public void skipEntityMapping();

	/**
	 * Informs whether the current mapping is for removal of records in the destination entity.
	 * In general, when mappings are configured to use deletion of records is uniVocity will automatically generate a mapping for exclusion.
	 *
	 * 

For example: suppose GroupMember has a reference to Group. * * If no removal of records is enabled, the mappings will be executed in the following order: *

    *
  • map: source -> Group
  • *
  • map: otherSource -> GroupMember
  • *
* * If removal is enabled in these mappings then uniVocity may generate exclusion mappings to be executed in reverse order. * The exact removal sequence depends on the mapping configuration. In this example, GroupMember records that might be associated with Group will be removed first. *
    *
  • remove: otherSource -> GroupMember
  • *
  • remove: source -> Group
  • *
  • map: source -> Group
  • *
  • map: otherSource -> GroupMember
  • *
* * @return true if this mapping will identify and remove records in the destination; false otherwise. */ public boolean isExclusionMapping(); /** * Identifies whether the current mapping has been skipped. * @return true if the current mapping has been skipped; false otherwise */ public boolean isEntityMappingSkipped(); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy