/// <summary>
        /// Apply changes to the target
        /// </summary>
        public void Apply(ICollectionInstance instance)
        {
            var proxy = GetPersistentType(instance.Relationship.Class.GetUnderlyingSystemType());

            if(proxy != null)
            {
                instance.Relationship.CustomClass(proxy);
            }
        }
Esempio n. 2
0
 public void Apply(ICollectionInstance instance)
 {
     string colName;
     var entityType = instance.EntityType;
     var childType = instance.ChildType;
     if (entityType == childType)//这里是专门对自身关联一对多的情况进行特殊处理,统一使用PARENT_ID作为外键列
         colName = "ParentId";
     else
     {
         colName = entityType.Name + "Id";
     }
     instance.Key.Column(colName);
     //instance.Cascade.AllDeleteOrphan();
 }
Esempio n. 3
0
 public void Apply(ICollectionInstance instance)
 {
     string colName = string.Empty;
     var entityType = instance.ChildType;
     var childType = instance.ChildType;
     if (entityType == childType)
     {
         colName = "PARENT_ID";
     }
     else
     {
         colName = entityType.Name.ToDatabaseName() + "_ID";
     }
     instance.Key.Column(colName);
     instance.Cascade.AllDeleteOrphan();
 }
 public void Apply(ICollectionInstance instance)
 {
     instance.Key.ForeignKey(string.Format("FK_{0}{1}",instance.Member.Name,instance.EntityType.Name+"Id"));
 }
 public virtual void Apply(ICollectionInstance instance)
 {
     string name = ((ICollectionInspector)instance).Name;
     Apply(instance.EntityType, name, instance.Access);
 }
Esempio n. 6
0
 public void Apply(ICollectionInstance instance)
 {
     instance.Access.Field();
 }
 public void Apply(ICollectionInstance instance)
 {
     instance.Cascade.SaveUpdate();
     instance.Inverse();
 }
 /// <summary>
 /// Apply changes to the target
 /// </summary>
 public void Apply(ICollectionInstance instance)
 {
     instance.Access.CamelCaseField(CamelCasePrefix.Underscore);
 }
 public void Apply(ICollectionInstance instance)
 {
     instance.Cache.ReadWrite();
 }
 protected override void Apply(CascadeAllDeleteOrphanAttribute attribute, ICollectionInstance instance)
 {
     instance.Cascade.AllDeleteOrphan();
 }
 public void Apply(ICollectionInstance instance)
 {
     var key = string.Format("FK_{0}_{1}", instance.Member.Name, instance.EntityType.Name);
     instance.Key.ForeignKey(key);
 }
Esempio n. 12
0
 protected abstract void Apply(T attribute, ICollectionInstance instance);
Esempio n. 13
0
 public void Apply(ICollectionInstance instance)
 {
     Apply(GetAttribute(instance), instance);
 }
Esempio n. 14
0
        public void Apply(ICollectionInstance instance)
        {
            var columnName = GetKeyName(null, instance.EntityType);

            instance.Key.Column(columnName);
        }
 public void Apply(ICollectionInstance instance)
 {
 }
 public void Apply(ICollectionInstance instance)
 {
     string constraint = GetConstraintName(instance.ChildType.Name, instance.EntityType.Name);
     instance.Key.ForeignKey(constraint);
 }
        public void Apply(ICollectionInstance instance)
        {
            var columnName = GetKeyName(null, instance.EntityType);

            instance.Key.Column(columnName);
        }
 public void Apply(ICollectionInstance instance)
 {
     instance.AsList();
 }
 public void Apply(ICollectionInstance instance)
 {
     var constraint = NameConventions.GetForeignKeyConstraintName(instance.ChildType.Name, instance.EntityType.Name);
     instance.Key.ForeignKey(constraint);
 }
 public void Apply(ICollectionInstance instance)
 {
     instance.Access.CamelCaseField(CamelCasePrefix.Underscore);
     instance.Cascade.AllDeleteOrphan();
     instance.Inverse();
 }
 public void Apply(ICollectionInstance instance)
 {
     instance.AsSet();
     instance.Cascade.All();
 }
Esempio n. 22
0
 public void Apply(ICollectionInstance instance) {
     instance.Cache.ReadWrite();
 }
 public void Apply(ICollectionInstance instance)
 {
     instance.Fetch.Select();
     instance.Cascade.All();
     instance.AsBag();
 }