public void Apply(IJoinedSubclassInstance instance) { if (instance.TableName != null) { instance.Table(AlterTableName(instance.TableName)); } }
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); }
/// <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); }
public void Apply(IJoinedSubclassInstance instance) { if (instance.Type.BaseType != null) { instance.Key.ForeignKey($"FK_{instance.Type.BaseType.Name}_{instance.EntityType.Name}"); } }
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); }
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)); }
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()}"); }
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) { string colName = PersistenceModelGenerator .GetColumnName(instance.Type.BaseType) .ToDatabaseName() + "_ID"; instance.Key.Column(colName); Debug.WriteLine("----IJoinedSubclassConvention----" + instance.Type); }
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()}"); } }
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); } }
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); }
/// <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); }
/// <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 ); }
/// <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); }
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); }
public void Apply(IJoinedSubclassInstance instance) { string tableName = NameConventions.GetTableName(instance.EntityType); instance.Table(tableName); }
public void Apply(IJoinedSubclassInstance instance) { instance.Key.Column("baseclassId"); }
/// <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 ); }
public void Apply(IJoinedSubclassInstance instance) { ApplyConventionForReferences(instance); ApplyConventionForProperties(instance); instance.Key.ForeignKey($"Fk_{instance.EntityType.Name}_{GetForeignKeyName(instance.Key.Columns)}".ToConventionCase()); }
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)); }
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))); }
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); }
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()); }
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(instance.EntityType.Name.Underscore()); instance.Key.Column("id"); }
public void Apply(IJoinedSubclassInstance instance) { instance.Key.ForeignKey(string.Format("{0}_Subclass_FK", instance.EntityType.Name)); }
public void Apply(IJoinedSubclassInstance instance) { instance.Table(instance.EntityType.Name + "Table"); instance.Key.Column(instance.EntityType.Name + "Id"); }
public void Apply(IJoinedSubclassInstance instance) { instance.Table(string.Format("{0}", instance.Type.Name.Replace("Entity", ""))); }
/// <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); }
/// <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)); }
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"); }
/// <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 }