public IALAttribute Clone(IALInterface newParent)
        {
            var clone = new BaseALAttribute(newParent, (BaseBTAttribute)this.BTAttribute);

            clone.Name = this.Name;
            return(clone);
        }
예제 #2
0
        private void PrepareBaseAttribute(IBTAttribute attr)
        {
            var baseAttr = new BaseALAttribute(this, (BT.BaseBTAttribute)attr);

            baseAttr.JoinAlias = "t0";
            Attributes.Add(baseAttr);
            if (attr.IsIdentity)
            {
                IdColumn = baseAttr;
            }
        }
예제 #3
0
 private void PrepareAttributes()
 {
     Attributes = new List <IALAttribute>();
     foreach (var attr in BTInterface.Attributes.OrderBy(a => a.GetBLAttribute().SortId))
     {
         if (attr is BT.BaseBTAttribute)
         {
             var baseAttr = new BaseALAttribute(this, (BT.BaseBTAttribute)attr);
             Attributes.Add(baseAttr);
             if (attr.IsIdentity && IdColumn == null)
             {
                 IdColumn = baseAttr;
             }
             else if (attr.IsIdentity)
             {
                 throw new InvalidStateException($"Die Dimension {this.Name} hat mehr als eine Identity-Spalte");
             }
         }
         else if (attr is BT.RefBTAttribute)
         {
             var refAttr = (BT.RefBTAttribute)attr;
             DimensionALInterface dim = null;
             // Prüfen, ob es sich um die Current-State-Table zur aktuellen Tabelle handelt
             if (this.BTInterface.IsHistoryTable && refAttr.ReferencedBTInterface.IsCurrentStateTable &&
                 refAttr.ReferencedBTInterface.coreInterface == this.BTInterface.coreInterface)
             {
                 dim = new DimensionALInterface(Model, refAttr, null, this.Depth + 1);
             }
             else
             {
                 dim = new DimensionALInterface(Model, refAttr, this.RootDimension, this.Depth + 1);
             }
             dim = Model.GetDimensionInterfaceFor(dim);
             Attributes.Add(new RefALAttribute(this, dim, refAttr));
         }
         else
         {
             throw new NotImplementedException($"DimensionALInterface.PrepareAttributes: Attributtyp {attr.GetType().Name} nicht unterstützt");
         }
     }
 }