private void copyAssociationEndProperties(UTF_EA.AssociationEnd source, UTF_EA.AssociationEnd target)
 {
     target.name           = source.name;
     target.EAMultiplicity = source.EAMultiplicity;
     target.isNavigable    = source.isNavigable;
     target.aggregation    = source.aggregation;
     target.ownedComments  = source.ownedComments;
     target.save();
 }
 private void copyAssociationEndProperties(UTF_EA.AssociationEnd source, UTF_EA.AssociationEnd target)
 {
     target.name           = source.name;
     target.EAMultiplicity = source.EAMultiplicity;
     target.isNavigable    = source.isNavigable;
     target.aggregation    = source.aggregation;
     target.ownedComments  = source.ownedComments;
     //TODO: copy alias of the AssociationEnd if the alias in the subset is empty.
     //target.save();
 }
        private void setEnds()
        {
            UTF_EA.AssociationEnd sourceEnd = ((UTF_EA.Association) this.sourceAssociation).sourceEnd;
            UTF_EA.AssociationEnd targetEnd = ((UTF_EA.Association) this.sourceAssociation).targetEnd;
            //check the source end
            var endType = sourceEnd.type as UTF_EA.ElementWrapper;

            //check if the source end is linked to the element with the parent ID of the wrappedProperty
            if (endType != null &&
                endType.id == this.wrappedProperty.Parent)
            {
                //check if the other end is linked to the same element
                if (endType.Equals(targetEnd.type))
                {
                    //the association is linked to the same element on both sides
                    //check the other properties to figure out which one we need as this end
                    if (sourceEnd.name == this.wrappedProperty.Name &&
                        sourceEnd.EAMultiplicity == new UTF_EA.Multiplicity(this.wrappedProperty.Cardinality.Length > 0 ? this.wrappedProperty.Cardinality : UTF_EA.AssociationEnd.defaultMultiplicity) &&
                        UTF_EA.AggregationKind.getEAAggregationKind(sourceEnd.aggregation) == this.wrappedProperty.Aggregation)
                    {
                        //the source end properties corresponds with the wrappedProperty properties
                        this._thisEnd  = targetEnd;
                        this._otherEnd = sourceEnd;
                    }
                    else
                    {
                        //source end properties don't correspond, so we assume the targetEnd to be this end
                        this._thisEnd  = sourceEnd;
                        this._otherEnd = targetEnd;
                    }
                }
                else
                {
                    //both sides are different
                    this._thisEnd  = sourceEnd;
                    this._otherEnd = targetEnd;
                }
            }
            else
            {
                //this end doesn't correspond with sourceEnd, so we assume the targetEnd to be this end
                this._thisEnd  = targetEnd;
                this._otherEnd = sourceEnd;
            }
        }
Пример #4
0
        protected DB2TableTransformer addDB2Table(UTF_EA.AssociationEnd associationEnd)
        {
            DB2TableTransformer transformer = addDB2Table(associationEnd.type as UTF_EA.Class);

            if (transformer == null)
            {
                transformer = this.tableTransformers.OfType <DB2TableTransformer>().FirstOrDefault(x => x.logicalClass.Equals(associationEnd.type));
            }
            if (transformer == null)
            {
                transformer = this.externalTableTransformers.FirstOrDefault(x => x.logicalClass.Equals(associationEnd.type));
            }
            if (transformer != null)
            {
                transformer.associationEnd = associationEnd;
            }
            return(transformer);
        }
Пример #5
0
 void setEndProperties(TSF_EA.AssociationEnd eaEnd, MDAssociationEnd mdEnd)
 {
     //set the aggregationKind
     if (mdEnd.aggregationKind == "shared")
     {
         eaEnd.aggregation = UML.Classes.Kernel.AggregationKind.shared;
     }
     else
     {
         eaEnd.aggregation = UML.Classes.Kernel.AggregationKind.none;
     }
     //set the name
     eaEnd.name = mdEnd.name;
     //set the multiplicity
     if (!string.IsNullOrEmpty(mdEnd.lowerBound) &&
         !string.IsNullOrEmpty(mdEnd.upperBound))
     {
         eaEnd.multiplicity = new TSF_EA.Multiplicity(mdEnd.lowerBound, mdEnd.upperBound);
     }
 }
 private void setEnds()
 {
     UTF_EA.AssociationEnd sourceEnd = ((UTF_EA.Association)this.sourceAssociation).sourceEnd;
     UTF_EA.AssociationEnd targetEnd = ((UTF_EA.Association)this.sourceAssociation).targetEnd;
     //check the source end
     var endType = sourceEnd.type as UTF_EA.ElementWrapper;
     //check if the source end is linked to the element with the parent ID of the wrappedProperty
     if (endType != null
         && endType.id == this.wrappedProperty.Parent)
     {
         //check if the other end is linked to the same element
         if (endType.Equals(targetEnd.type))
         {
             //the association is linked to the same element on both sides
             //check the other properties to figure out which one we need as this end
             if (sourceEnd.name == this.wrappedProperty.Name
                 && sourceEnd.multiplicity == new Multiplicity(this.wrappedProperty.Cardinality.Length > 0 ? this.wrappedProperty.Cardinality : AssociationEnd.defaultMultiplicity)
                 && UTF_EA.AggregationKind.getEAAggregationKind(sourceEnd.aggregation) == this.wrappedProperty.Aggregation)
             {
                 //the source end properties corresponds with the wrappedProperty properties
                 this._thisEnd = sourceEnd;
                 this._otherEnd = targetEnd;
             }
             else
             {
                 //source end properties don't correspond, so we assume the targetEnd to be this end
                 this._thisEnd = targetEnd;
                 this._otherEnd = sourceEnd;
             }
         }
         else
         {
             //both sides are different
             this._thisEnd = sourceEnd;
             this._otherEnd = targetEnd;
         }
     }
     else
     {
         //this end doesn't correspond with sourceEnd, so we assume the targetEnd to be this end
         this._thisEnd = targetEnd;
         this._otherEnd = sourceEnd;
     }
 }
 public EAForeignKeyTransformer(ForeignKey foreignKey, UTF_EA.AssociationEnd associationEnd, NameTranslator nameTranslator) : this(nameTranslator)
 {
     _foreignKey            = foreignKey;
     _logicalAssociationEnd = associationEnd;
 }
 public DB2ForeignKeyTransformer(Table table, List <Column> FKInvolvedColumns, DB2TableTransformer dependingTransformer, UTF_EA.AssociationEnd associationEnd, NameTranslator nameTranslator) : base(nameTranslator)
 {
     this._foreignKey = new ForeignKey((Table)table, FKInvolvedColumns);
     this._foreignKey.foreignTable = dependingTransformer.table;
     this._logicalAssociationEnd   = associationEnd;
     //get the association on which this foreign key is based
     if (associationEnd != null)
     {
         this._foreignKey.logicalAssociation = (UTF_EA.Association)associationEnd.association;
     }
     table.constraints.Add(this._foreignKey);
     //reset the name of the foreign key
     resetName();
     //make sure we get the correct override settings for the FK and the involved columns
     var dummy = this._foreignKey.isOverridden;
 }
 public DB2ForeignKeyTransformer(ForeignKey foreignKey, UTF_EA.AssociationEnd associationEnd, NameTranslator nameTranslator) : base(foreignKey, associationEnd, nameTranslator)
 {
 }
 private Column transformLogicalAssociationEnd(UTF_EA.AssociationEnd associationEnd)
 {
     throw new NotImplementedException();
 }
Пример #11
0
 public DB2ColumnTransformer(Table table, Column involvedColumn, DB2TableTransformer dependingTransformer, UTF_EA.AssociationEnd associationEnd, NameTranslator nameTranslator) : this(table, nameTranslator)
 {
     this._involvedColumn       = involvedColumn;
     this._dependingTransformer = dependingTransformer;
     this._associationEnd       = associationEnd;
     _column                  = new Column((DB_EA.Table)table, involvedColumn.name);
     _column.type             = involvedColumn.type;
     _column.logicalAttribute = ((DB_EA.Column)involvedColumn).logicalAttribute;
     if (this._associationEnd != null)
     {
         if (_associationEnd.lower > 0)
         {
             _column.isNotNullable = true;
         }
     }
 }