use of org.finos.legend.pure.generated.Root_meta_pure_mapping_xStore_XStoreAssociationImplementation_Impl in project legend-engine by finos.
the class HelperMappingBuilder method processAssociationImplementation.
public static AssociationImplementation processAssociationImplementation(AssociationMapping associationMapping, CompileContext context, Mapping parentMapping) {
if (associationMapping instanceof XStoreAssociationMapping) {
XStoreAssociationMapping xStoreAssociationMapping = (XStoreAssociationMapping) associationMapping;
XStoreAssociationImplementation base = new Root_meta_pure_mapping_xStore_XStoreAssociationImplementation_Impl("");
final org.finos.legend.pure.m3.coreinstance.meta.pure.metamodel.relationship.Association pureAssociation = context.resolveAssociation(xStoreAssociationMapping.association);
MutableList<Store> stores = ListIterate.collect(xStoreAssociationMapping.stores, context::resolveStore);
base._association(pureAssociation)._stores(stores)._parent(parentMapping)._propertyMappings(ListIterate.collect(xStoreAssociationMapping.propertyMappings, propertyMapping -> propertyMapping.accept(new PropertyMappingBuilder(context, parentMapping, base, HelperMappingBuilder.getAllClassMappings(parentMapping)))));
return base;
}
return context.getCompilerExtensions().getExtraAssociationMappingProcessors().stream().map(processor -> processor.value(associationMapping, parentMapping, context)).filter(Objects::nonNull).findFirst().orElseThrow(() -> new UnsupportedOperationException("Unsupported association mapping type '" + associationMapping.getClass() + "'"));
}
Aggregations