Ejemplo n.º 1
0
        public void Apply(IJoinedSubclassInstance instance)
        {
            string tableName = NameConventions.GetTableName(instance.EntityType);

            instance.Table(tableName);
            instance.BatchSize(25);
        }
Ejemplo n.º 2
0
        public void Apply(IIdentityInstance instance)
        {
            string sequenceName = NameConventions.GetSequenceName(instance.EntityType);
            string columnName   = NameConventions.GetPrimaryKeyColumnName(instance.EntityType);

            instance.Column(columnName);
            instance.GeneratedBy.Native(paramBuilder => paramBuilder.AddParam("sequence", sequenceName));
        }
Ejemplo n.º 3
0
 private static string GetTableName(Type entityType, Type otherSideType)
 {
     return(NameConventions.GetTableName(entityType) + "_" + NameConventions.GetTableName(otherSideType));
 }
        protected override string GetKeyName(Member member, Type type)
        {
            string name = NameConventions.ReplaceCamelCaseWithUnderscore(member == null ? type.Name : member.Name);

            return(string.Format("{0}_ID", name.ToUpper()));
        }
Ejemplo n.º 5
0
        public void Apply(IPropertyInstance instance)
        {
            var name = NameConventions.ReplaceCamelCaseWithUnderscore(instance.Name);

            instance.Column(name.ToUpper());
        }
        private static string GetConstraintName(string child, string parent)
        {
            var constraintName = string.Format("FK_{0}_{1}", NameConventions.ReplaceCamelCaseWithUnderscore(child).ToUpper(), NameConventions.ReplaceCamelCaseWithUnderscore(parent).ToUpper());

            return(constraintName);
        }
 private static string GetManyToManyConstraintName(string tableName, string entityName)
 {
     return(string.Format("FK_{0}_{1}", NameConventions.ReplaceCamelCaseWithUnderscore(tableName), NameConventions.ReplaceCamelCaseWithUnderscore(entityName)).ToUpper());
 }