예제 #1
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     if (instance.TableName != null)
     {
         instance.Table(AlterTableName(instance.TableName));
     }
 }
예제 #2
0
        public void Apply(IJoinedSubclassInstance instance)
        {
            if (instance.Key.EntityType != null)
                instance.Key.Column("Id" + instance.Key.EntityType.Name);

            instance.Key.Column("Id" + instance.Type.Name);
        }
		public void Apply(IJoinedSubclassInstance instance)
		{
			string tableName = NameConventions.GetTableName(instance.EntityType);

			instance.Table(tableName);
			instance.BatchSize(25);
		}
예제 #4
0
        /// <summary>
        /// Applies Foriegn key based on type.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply(IJoinedSubclassInstance instance)
        {
            var name = string.Format("FK_{0}_{1}", instance.EntityType.Name, instance.EntityType.BaseType.Name);

            name = name.ToLower();
            instance.Key.ForeignKey(name);
        }
예제 #5
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     if (instance.TableName != null)
     {
         instance.Table(AlterTableName(instance.TableName));
     }
 }
예제 #6
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     if (instance.Type.BaseType != null)
     {
         instance.Key.ForeignKey($"FK_{instance.Type.BaseType.Name}_{instance.EntityType.Name}");
     }
 }
예제 #7
0
        public void Apply(IJoinedSubclassInstance instance)
        {
            var tableName = NameConventions.Quote(NameConventions.GetTableName(instance.EntityType));

            instance.Table(tableName);
            instance.BatchSize(25);
        }
        public void Apply(IJoinedSubclassInstance instance)
        {
            var type = instance.EntityType;
            var baseType = type.BaseType;
            if (baseType == null) return;

            var constraintName = NameConventions.GetForeignKeyConstraintName(type.Name, baseType.Name);
            instance.Key.ForeignKey(constraintName);
        }
 public void Apply(IJoinedSubclassInstance instance)
 {
     string colName = PersistenceModelGenerator
                          .GetColumnName(instance.Type.BaseType)
                          .ToDatabaseName()
                      + "_ID";
     instance.Key.Column(colName);
     Debug.WriteLine("----IJoinedSubclassConvention----"+instance.Type);
 }
예제 #10
0
        public void Apply(IJoinedSubclassInstance instance)
        {
            foreach (var item in instance.References)
            {
                SetManyToOneForeignKey(item, instance);
            }

            instance.Key.ForeignKey("Fk" + instance.EntityType.Name + "_" + GetColumnName(instance.Key.Columns));
        }
예제 #11
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     if (instance.TableName.IsNotNull())
     {
         instance.Table(
             string.Format("`{0}_{1}`", Prefix, instance.TableName.Replace("`", ""))
             );
     }
 }
        public void Apply(IJoinedSubclassInstance instance)
        {
            // pluralize table names
            instance.Table(instance.EntityType.Name.Pluralize());

            if (instance.Type.BaseType != null)
                instance.Key.ForeignKey(
                    $"FK_{instance.EntityType.Name.Pluralize()}_Join_{instance.Type.BaseType.Name.Pluralize()}");
        }
예제 #13
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     //instance.Key.Column(string.Format("{0}_id", instance.EntityType.Name.ToCamelCase()));
     //foreach (var column in instance.Key.Columns.OfType<ColumnInstance>()) {
     //    column.Set(x => x.Name, Layer.Defaults, column.Name.ToCamelCase());
     //}
     instance.Key.Column("[id]");
     //instance.Key.Column("[revision]");
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     if (instance.TableName.IsNotNull())
     {
         instance.Table(
             string.Format("`{0}_{1}`", Prefix, instance.TableName.Replace("`", ""))
         );
     }
 }
        public void Apply(IJoinedSubclassInstance instance)
        {
            string colName = PersistenceModelGenerator
                             .GetColumnName(instance.Type.BaseType)
                             .ToDatabaseName()
                             + "_ID";

            instance.Key.Column(colName);
            Debug.WriteLine("----IJoinedSubclassConvention----" + instance.Type);
        }
예제 #16
0
    public void Apply(IJoinedSubclassInstance instance)
    {
        Type basetype = instance.Extends;

        while (basetype.IsAbstract)
        {
            basetype = basetype.BaseType;
        }
        instance.Key.Column(basetype.Name + "Id");
    }
        public void Apply(IJoinedSubclassInstance instance)
        {
            // pluralize table names
            instance.Table(instance.EntityType.Name.Pluralize());

            if (instance.Type.BaseType != null)
            {
                instance.Key.ForeignKey(
                    $"FK_{instance.EntityType.Name.Pluralize()}_Join_{instance.Type.BaseType.Name.Pluralize()}");
            }
        }
예제 #18
0
        public void Apply(IJoinedSubclassInstance instance)
        {
            var attribute = GetAttribute(instance.EntityType);

            if (attribute == null)
            {
                return;
            }
            instance.Table(attribute.TableName);
            if (!String.IsNullOrEmpty(attribute.Schema))
            {
                instance.Schema(attribute.Schema);
            }
        }
예제 #19
0
        public void Apply(IJoinedSubclassInstance instance)
        {
            var type     = instance.EntityType;
            var baseType = type.BaseType;

            if (baseType == null)
            {
                return;
            }

            var constraintName = NameConventions.GetForeignKeyConstraintName(type.Name, baseType.Name);

            instance.Key.ForeignKey(constraintName);
        }
예제 #20
0
        /// <summary>
        /// Adds Module namespace to schema.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply(IJoinedSubclassInstance instance)
        {
            var namespaces = instance.EntityType.Namespace.Split(".".ToCharArray());

            foreach (var ns in namespaces)
            {
                if (ns.Contains("Module"))
                {
                    instance.Schema(ns);
                    break;
                }
            }

            var key = instance.EntityType.BaseType.Name + "Key";

            instance.Key.Column(key);
        }
예제 #21
0
        /// <summary>
        /// Adds Module namespace to schema.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply( IJoinedSubclassInstance instance )
        {
            var namespaces = instance.EntityType.Namespace.Split ( ".".ToCharArray () );

            foreach ( var ns in namespaces )
            {
                if ( ns.Contains ( "Module" ) )
                {
                    instance.Schema ( ns );
                    break;
                }
            }

            var key = instance.EntityType.BaseType.Name + "Key";

            instance.Key.Column ( key );
        }
예제 #22
0
        /// <summary>
        /// Adds Module namespace to schema.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply(IJoinedSubclassInstance instance)
        {
            var type      = instance.EntityType;
            var schema    = SchemaConvention.GetModuleName(type);
            var tableName = TableNameConvention.GetTableName(type);

            var attr = type.GetAttribute <MapTableAttribute>();
            var key  = instance.EntityType.BaseType.Name;

            key = $"{key}_Id";
            key = attr?.PrimaryKey ?? key;
            key = key.ToLower();
            if (!schema.IsNullOrEmpty())
            {
                instance.Schema(schema);
            }
            instance.Table($"{tableName}");
            instance.Key.Column(key);
        }
예제 #23
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Table("tbl");
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     var tableName = instance.EntityType.Name.ToPlural();
     instance.Table(NameConventions.ReplaceCamelCaseWithUnderscore(tableName));
     instance.BatchSize(250);
 }
예제 #25
0
        public void Apply(IJoinedSubclassInstance instance)
        {
            string tableName = NameConventions.GetTableName(instance.EntityType);

            instance.Table(tableName);
        }
예제 #26
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Key.Column("baseclassId");
 }
예제 #27
0
 /// <summary>
 /// Applies Foriegn key based on type.
 /// </summary>
 /// <param name="instance">The instance.</param>
 public void Apply( IJoinedSubclassInstance instance )
 {
     var name = string.Format ( "{0}_{1}_FK", instance.EntityType.Name, instance.EntityType.BaseType.Name );
     instance.Key.ForeignKey ( name );
 }
예제 #28
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     ApplyConventionForReferences(instance);
     ApplyConventionForProperties(instance);
     instance.Key.ForeignKey($"Fk_{instance.EntityType.Name}_{GetForeignKeyName(instance.Key.Columns)}".ToConventionCase());
 }
예제 #29
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Key.Column(GetConventionname(null, instance.Type.BaseType));
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     //			Type type = instance.Type.BaseType;
     //			string constraint = GetConstraintName(type.Name, ((Member) null).Name);
     //			instance.Key.ForeignKey(constraint);
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Table(GetTableName(instance.EntityType.Name));
 }
예제 #32
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Table(instance.EntityType.Name.ToPlural());
     instance.BatchSize(250);
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Table(Singularizer.Singularize(this.CleanTableName(instance.EntityType.Name)));
 }
예제 #34
0
        public void Apply(IJoinedSubclassInstance instance)
        {
            string keyName = this.GetKeyName(null, instance.Type.BaseType);

            instance.Key.Column(keyName);
        }
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Key.Column("Id");
     instance.Key.ForeignKey("fk_" + instance.EntityType.Name);
 }
예제 #36
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Schema(Schema);
     instance.Table(instance.EntityType.Name + ConventionConstants.TableSuffix);
     instance.Key.Column(instance.EntityType.BaseType.Name + ConventionConstants.Id);
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Table(instance.EntityType.Name.ToDatabaseName());
 }
예제 #38
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Table("test-table");
     instance.Key.Column("test");
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     var columnName = GetKeyName(null, instance.Type.BaseType);
     
     instance.Key.Column(columnName);
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Table(Singularizer.Singularize(this.CleanTableName(instance.EntityType.Name)));
 }
        public void Apply(IJoinedSubclassInstance instance)
        {
            var columnName = GetKeyName(null, instance.Type.BaseType);

            instance.Key.Column(columnName);
        }
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Table(instance.EntityType.Name.Underscore());
     instance.Key.Column("id");
 }
예제 #43
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Schema(Schema);
     instance.Table(instance.EntityType.Name + ConventionConstants.TableSuffix);
     instance.Key.Column(instance.EntityType.BaseType.Name + ConventionConstants.Id);
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Key.ForeignKey(string.Format("{0}_Subclass_FK", instance.EntityType.Name));
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     //			Type type = instance.Type.BaseType;
     //			string constraint = GetConstraintName(type.Name, ((Member) null).Name);
     //			instance.Key.ForeignKey(constraint);
 }
 public void Apply(IJoinedSubclassInstance instance) {
     instance.Table(instance.EntityType.Name + "Table");
     instance.Key.Column(instance.EntityType.Name + "Id");
 }
예제 #47
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Table(string.Format("{0}", instance.Type.Name.Replace("Entity", "")));
 }
예제 #48
0
        /// <summary>
        /// Applies Foriegn key based on type.
        /// </summary>
        /// <param name="instance">The instance.</param>
        public void Apply(IJoinedSubclassInstance instance)
        {
            var name = string.Format("{0}_{1}_FK", instance.EntityType.Name, instance.EntityType.BaseType.Name);

            instance.Key.ForeignKey(name);
        }
예제 #49
0
 /// <summary>
 /// Does nothing.
 /// </summary>
 /// <param name="instance">The instance.</param>
 public void Apply(IJoinedSubclassInstance instance)
 {
     // We don't need to create an unique index for the base type key since this key is now treated as a primary key
 }
        public void Apply(IJoinedSubclassInstance instance)
        {
            string typeName = instance.EntityType.Name;

            instance.Table(Inflector.Inflector.Pluralize(typeName));
        }
예제 #51
0
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Key.ForeignKey($"FK_{instance.EntityType.Name}_{instance.EntityType.BaseType?.Name}");
 }
 public void Apply(IJoinedSubclassInstance instance)
 {
     instance.Key.Column("xxx");
 }
예제 #53
0
 /// <summary>
 /// Does nothing.
 /// </summary>
 /// <param name="instance">The instance.</param>
 public void Apply( IJoinedSubclassInstance instance )
 {
     // We don't need to create an unique index for the base type key since this key is now treated as a primary key
 }