예제 #1
0
    public Analyzer(List <Statement> program)
    {
        var environment        = new Environment();
        var expressionAnalyzer = new ExpressionAnalyzer(environment);

        statementAnalyzer = new StatementAnalyzer(program, expressionAnalyzer, environment);
    }
예제 #2
0
 public EmitRepositoryBuilder(
     string scopeTemplate
     , Func <Type, MethodInfo, String> sqlIdNamingConvert
     , ILogger logger
     )
 {
     _sqlIdNamingConvert = sqlIdNamingConvert;
     _logger             = logger;
     _templateParser     = new ScopeTemplateParser(scopeTemplate);
     _statementAnalyzer  = new StatementAnalyzer();
     InitAssembly();
 }
예제 #3
0
 public CUDSqlGenerator(SmartSqlConfig config)
 {
     _generatorFuncList = new Dictionary <string, Func <GeneratorParams, Statement> >
     {
         { CUDStatementName.GET_BY_ID, BuildGetEntity },
         { CUDStatementName.INSERT, BuildInsert },
         { CUDStatementName.INSERT_RETURN_ID, BuildInsertReturnId },
         { CUDStatementName.UPDATE, BuildUpdate },
         { CUDStatementName.DELETE_BY_ID, BuildDeleteById },
         { CUDStatementName.DELETE_ALL, BuildDeleteAll },
         { CUDStatementName.DELETE_MANY, BuildDeleteMany },
     };
     _provider = config.Database.DbProvider;
     _analyzer = new StatementAnalyzer();
 }
예제 #4
0
 public SmartSqlConfig()
 {
     Settings             = Settings.Default;
     SqlMaps              = new Dictionary <string, SqlMap>();
     ObjectFactoryBuilder = new ExpressionObjectFactoryBuilder();
     TagBuilderFactory    = new TagBuilderFactory();
     TypeHandlerFactory   = new TypeHandlerFactory();
     LoggerFactory        = NullLoggerFactory.Instance;
     DeserializerFactory  = new DeserializerFactory();
     Properties           = new Properties();
     IdGenerator          = SnowflakeId.Default;
     DbSessionFactory     = new DbSessionFactory(this);
     SessionStore         = new DbSessionStore(DbSessionFactory);
     StatementAnalyzer    = new StatementAnalyzer();
 }
예제 #5
0
 public SmartSqlConfig()
 {
     Settings             = Settings.Default;
     SqlMaps              = new Dictionary <string, SqlMap>();
     Filters              = new FilterCollection();
     ObjectFactoryBuilder = new ExpressionObjectFactoryBuilder();
     TagBuilderFactory    = new TagBuilderFactory();
     TypeHandlerFactory   = new TypeHandlerFactory();
     LoggerFactory        = NullLoggerFactory.Instance;
     DeserializerFactory  = new DeserializerFactory();
     Properties           = new Properties();
     IdGenerators         = new Dictionary <string, IIdGenerator>
     {
         { nameof(SnowflakeId.Default), SnowflakeId.Default }
     };
     DbSessionFactory         = new DbSessionFactory(this);
     SessionStore             = new DbSessionStore(DbSessionFactory);
     StatementAnalyzer        = new StatementAnalyzer();
     InvokeSucceedListener    = new InvokeSucceedListener();
     DbSessionFactory.Opened += (sender, args) => { InvokeSucceedListener.BindDbSessionEvent(args.DbSession); };
 }