Exemplo n.º 1
0
        private CodeFile GenerateSelectByPrimaryKeyFunction(ApplicationType type, Field field, Domain domain)
        {
            var adapter = new SelectByFieldsDbTypeAdapter(type, $"select_by_{field.Name}", new List <Field> {
                field
            }, OperationType.Select, domain, true);

            return(GenerateTemplateFromAdapter(adapter, "SelectByForeignKeyTemplate"));
        }
Exemplo n.º 2
0
        private CodeFile GenerateSelectByConstraint(ApplicationType type, Constraint constraint, Domain domain)
        {
            var adapter = new SelectByFieldsDbTypeAdapter(type, $"select_by_{constraint.Name}", constraint.Fields, OperationType.Select, domain, false);

            return(GenerateTemplateFromAdapter(adapter, "SelectByForeignKeyTemplate"));
        }