Esempio n. 1
0
 protected override void InternalGetAttributeGroupItems(OrmAttributeGroup @group, Dictionary <string, Defaultable> groupItems)
 {
     if (group == AttributeGroup)
     {
         groupItems.Add("EmitDefaultValue", EmitDefaultValue);
         groupItems.Add("IsRequired", IsRequired);
         groupItems.Add("Order", Order);
     }
 }
Esempio n. 2
0
 public void FillAttributeGroupItems(Dictionary <string, Defaultable> result, OrmAttributeGroup @group)
 {
     foreach (IOrmAttribute ormAttribute in GetAllOrmAttributes())
     {
         Dictionary <string, Defaultable> attributeGroupItems = ormAttribute.GetAttributeGroupItems(group);
         foreach (var attributeGroupItem in attributeGroupItems)
         {
             result.Add(attributeGroupItem.Key, attributeGroupItem.Value);
         }
     }
 }
Esempio n. 3
0
        public Dictionary <string, Defaultable> GetAttributeGroupItems(OrmAttributeGroup @group)
        {
            var result = new Dictionary <string, Defaultable>();

            if (group == ATTRIBUTE_GROUP_KEY)
            {
                result.Add(ATTRIBUTE_GROUP_ITEM_DIRECTION, this.Direction);
                result.Add(ATTRIBUTE_GROUP_ITEM_POSITION, this.Position);
            }

            return(result);
        }
Esempio n. 4
0
        public virtual Dictionary <string, Defaultable> GetAttributeGroupItems(OrmAttributeGroup @group)
        {
            Dictionary <string, Defaultable> result          = new Dictionary <string, Defaultable>();
            Defaultable <string>             nameDefaultable = new Defaultable <string>();

            if (!string.IsNullOrEmpty(this.Name))
            {
                nameDefaultable.Value = this.Name;
            }
            result.Add("Name", nameDefaultable);
            InternalGetAttributeGroupItems(group, result);

            return(result);
        }
Esempio n. 5
0
        protected override void InternalGetAttributeGroupItems(OrmAttributeGroup @group, Dictionary <string, Defaultable> groupItems)
        {
            if (group == AttributeGroup)
            {
                groupItems.Add("IsReference", IsReference);

                Defaultable <string> namespaceDefaultable = new Defaultable <string>();
                if (!string.IsNullOrEmpty(this.Namespace))
                {
                    namespaceDefaultable.Value = this.Namespace;
                }
                groupItems.Add("Namespace", namespaceDefaultable);
            }
        }
Esempio n. 6
0
        public Dictionary <string, Defaultable> GetAttributeGroupItems(OrmAttributeGroup @group)
        {
            Dictionary <string, Defaultable> result = new Dictionary <string, Defaultable>();

            if (group == ATTRIBUTE_GROUP_KEY_GENERATOR)
            {
                var defaultableItems = GetDefaultableItems();

                result.Add(ATTRIBUTE_GROUP_ITEM_KIND, defaultableItems.Item1);
                result.Add(ATTRIBUTE_GROUP_ITEM_NAME, defaultableItems.Item2);
                result.Add(ATTRIBUTE_GROUP_ITEM_TYPE, defaultableItems.Item3);
            }

            return(result);
        }
Esempio n. 7
0
        public override Dictionary <string, Defaultable> GetAttributeGroupItems(OrmAttributeGroup @group)
        {
            Dictionary <string, Defaultable> result = new Dictionary <string, Defaultable>();

            if (group == ATTRIBUTE_GROUP_ASSOCIATION)
            {
                result.Add("PairTo", PairTo);

                var onOwnerRemove = GetDefaultableOnRemoveAction(true);
                result.Add("OnOwnerRemove", onOwnerRemove);

                var onTargetRemove = GetDefaultableOnRemoveAction(false);
                result.Add("OnTargetRemove", onTargetRemove);
            }

            return(result);
        }
Esempio n. 8
0
        public Dictionary <string, Defaultable> GetAttributeGroupItems(OrmAttributeGroup @group)
        {
            Dictionary <string, Defaultable> result = new Dictionary <string, Defaultable>();

            if (group == ATTRIBUTE_GROUP_TYPE_DISCRIMINATOR_VALUE)
            {
                //if (this.Enabled)
                {
                    Defaultable <bool> defaultable = GetDefaultAsDefaultable();
                    result.Add(ATTRIBUTE_GROUP_ITEM_DEFAULT, defaultable);

                    Defaultable <ObjectValue> defValue = new Defaultable <ObjectValue>();
                    defValue.SetAsCustom(this.Value);

                    result.Add(ATTRIBUTE_GROUP_ITEM_VALUE, defValue);
                }
            }

            return(result);
        }
Esempio n. 9
0
        public Dictionary <string, Defaultable> GetAttributeGroupItems(OrmAttributeGroup @group)
        {
            Dictionary <string, Defaultable> attributeGroupItems = new Dictionary <string, Defaultable>();

            if (GetAttributeGroup().EqualsTo(@group))
            {
                if (this.Mode != PropertyConstrainMode.Default)
                {
                    attributeGroupItems.Add("Mode", GetModeAsDefaultable());
                }

                if (!string.IsNullOrEmpty(this.ErrorMessage))
                {
                    attributeGroupItems.Add("Message", GetErrorMessageAsDefaultable());
                }

                FillAttributeGroupItems(attributeGroupItems);
            }
            return(attributeGroupItems);
        }
Esempio n. 10
0
        public Dictionary <string, Defaultable> GetAttributeGroupItems(OrmAttributeGroup @group)
        {
            Dictionary <string, Defaultable> result = new Dictionary <string, Defaultable>();

            if (group == ATTRIBUTE_GROUP_HIERARCHY_ROOT)
            {
                //if (this.Enabled)
                {
                    Defaultable <HierarchyRootInheritanceSchema> defInheritanceSchema = GetDefInheritanceSchema();
                    result.Add("InheritanceSchema", defInheritanceSchema);

                    result.Add("IncludeTypeId", IncludeTypeId);
                }
            }
            else if (group == ATTRIBUTE_GROUP_TABLE_MAPPING)
            {
                result.Add("Name", this.MappingName);
            }

            return(result);
        }
Esempio n. 11
0
        public override Dictionary <string, Defaultable> GetAttributeGroupItems(OrmAttributeGroup @group)
        {
            var result = new Dictionary <string, Defaultable>();

            if (group == ATTRIBUTE_GROUP_FIELD)
            {
                #region DefaultValue

                Defaultable <ObjectValue> defValue = GetDefaultValueAsDefaultable();
                result.Add(ATTRIBUTE_GROUP_ITEM_DEFAULT_VALUE, defValue);

                #endregion DefaultValue

                result.Add(ATTRIBUTE_GROUP_ITEM_INDEXED, this.Indexed);
                result.Add(ATTRIBUTE_GROUP_ITEM_NULLABLE, this.Nullable);
                result.Add(ATTRIBUTE_GROUP_ITEM_PRECISION, this.Precision);
                result.Add(ATTRIBUTE_GROUP_ITEM_SCALE, this.Scale);
                result.Add(ATTRIBUTE_GROUP_ITEM_LAZY_LOAD, this.LazyLoad);
                result.Add(ATTRIBUTE_GROUP_ITEM_LENGTH, this.Length);
                result.Add(ATTRIBUTE_GROUP_ITEM_NULLABLE_ON_UPGRADE, this.NullableOnUpgrade);
            }
            else if (group == ATTRIBUTE_GROUP_FIELD_MAPPING)
            {
                result.Add(ATTRIBUTE_GROUP_ITEM_NAME, this.MappingName);
            }
            else if (group == ATTRIBUTE_GROUP_VERSION)
            {
                result.Add(ATTRIBUTE_GROUP_ITEM_MODE, this.Version);
            }
            else if (group == ATTRIBUTE_GROUP_TYPE_DISCRIMINATOR)
            {
                // nothing to add, attribute without parameters
            }

            //this.Constraints.FillAttributeGroupItems(result, group);

            return(result);
        }
Esempio n. 12
0
 public bool EqualsTo(OrmAttributeGroup @group)
 {
     return(Util.StringEqual(this.Name, @group.Name, false) &&
            Util.StringEqual(this.Namespace, @group.Namespace, false));
 }
Esempio n. 13
0
 public abstract Dictionary <string, Defaultable> GetAttributeGroupItems(OrmAttributeGroup @group);
Esempio n. 14
0
 protected abstract void InternalGetAttributeGroupItems(OrmAttributeGroup @group,
                                                        Dictionary <string, Defaultable> groupItems);
Esempio n. 15
0
        public OrmAttributeGroup[] GetAttributeGroups(AttributeGroupsListMode listMode)
        {
            OrmAttributeGroup attributeGroup = GetOrmAttributeGroup();

            return(new[] { attributeGroup });
        }