Search in sources :

Example 16 with JoinParameter

use of eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter in project hale by halestudio.

the class JoinMergeMigrator method mergeJoinSource.

@SuppressWarnings("unused")
private void mergeJoinSource(MutableCell cell, EntityDefinition source, Cell match, Cell originalCell, SimpleLog log, JoinContext context, boolean groovy) {
    /*
		 * Sources: Add all from match (should be at least two)
		 */
    addSources(cell, source, match, log, false);
    // add source that was replaced and filter/contexts were not retained
    context.addStrippedSource(source);
    /*
		 * Join order: Replace type with matched sources (use match join order)
		 */
    JoinParameter matchParameter = CellUtil.getFirstParameter(match, JoinFunction.PARAMETER_JOIN).as(JoinParameter.class);
    if (matchParameter != null) {
        context.addOrderReplacement((TypeEntityDefinition) source, matchParameter.getTypes().toArray(new TypeEntityDefinition[matchParameter.getTypes().size()]));
    }
    // add join match to context (for match conditions)
    context.addJoinMatch(match);
    if (groovy) {
        addScript(match, context);
    }
}
Also used : TypeEntityDefinition(eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition) JoinParameter(eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter)

Aggregations

JoinParameter (eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter)16 JoinCondition (eu.esdihumboldt.hale.common.align.model.functions.join.JoinParameter.JoinCondition)11 TypeEntityDefinition (eu.esdihumboldt.hale.common.align.model.impl.TypeEntityDefinition)10 ArrayList (java.util.ArrayList)7 Cell (eu.esdihumboldt.hale.common.align.model.Cell)5 ParameterValue (eu.esdihumboldt.hale.common.align.model.ParameterValue)5 PropertyEntityDefinition (eu.esdihumboldt.hale.common.align.model.impl.PropertyEntityDefinition)4 HashSet (java.util.HashSet)4 Type (eu.esdihumboldt.hale.common.align.model.Type)3 FamilyInstance (eu.esdihumboldt.hale.common.instance.model.FamilyInstance)3 Instance (eu.esdihumboldt.hale.common.instance.model.Instance)3 List (java.util.List)3 ArrayListMultimap (com.google.common.collect.ArrayListMultimap)2 ListMultimap (com.google.common.collect.ListMultimap)2 JoinDefinition (eu.esdihumboldt.cst.functions.core.join.JoinUtil.JoinDefinition)2 Alignment (eu.esdihumboldt.hale.common.align.model.Alignment)2 EntityDefinition (eu.esdihumboldt.hale.common.align.model.EntityDefinition)2 TransformationException (eu.esdihumboldt.hale.common.align.transformation.function.TransformationException)2 ComplexValue (eu.esdihumboldt.hale.common.core.io.impl.ComplexValue)2 AttributeMappingType (eu.esdihumboldt.hale.io.appschema.impl.internal.generated.app_schema.AttributeMappingType)2