Exemplo n.º 1
0
        public static SqlQuery Create <T>(IConventionReader conventionReader)
        {
            var sqlQuery = new SqlQuery(conventionReader);

            sqlQuery.EnsureSubQuery <T>();

            return(sqlQuery);
        }
Exemplo n.º 2
0
        public SqlQuery(IConventionReader conventionReader)
        {
            _conventionReader = conventionReader;

            SubQueries          = new List <AliasedSqlSubQuery>();
            Joins               = new List <SqlSubQueryJoin>();
            QueryExpressionTree = new EmptyQueryExpressionTree();
            ObjectRelations     = new List <ObjectRelation>();
            _orderByStatements  = new List <OrderByStatement>();
        }
Exemplo n.º 3
0
        public static AliasedSqlSubQuery Create(string alias, Type type, IConventionReader conventionReader)
        {
            var subQuery = new AliasedSqlSubQuery()
            {
                Alias     = alias,
                TableName = conventionReader.GetTableName(type),
                AllSelectableColumnNames = conventionReader.GetSelectableColumNames(type).ToList(),
                PrimaryKeyColumnName     = conventionReader.TryGetPrimaryKeyColumnName(type)
            };

            return(subQuery);
        }
Exemplo n.º 4
0
 public abstract QueryExpressionTree Translate(IConventionReader conventionReader);
Exemplo n.º 5
0
 public override QueryExpressionTree Translate(IConventionReader conventionReader)
 {
     return this;
 }
Exemplo n.º 6
0
 public override QueryExpressionTree Translate(IConventionReader conventionReader)
 {
     return new TranslatedQueryExpressionTreeLeaf(QueryExpression.Translate(conventionReader), TableIdentifier.GetTableIdentifier(conventionReader));
 }
Exemplo n.º 7
0
 public OrderByStatement Translate(IConventionReader convention)
 {
     return(new OrderByStatement(convention.GetColumnName(PropertyName, Type), Direction));
 }
Exemplo n.º 8
0
 public string GetTableIdentifier(IConventionReader conventionReader)
 {
     return(_alias ?? conventionReader.GetTableName(_type));
 }
Exemplo n.º 9
0
 public override QueryExpressionTree Translate(IConventionReader conventionReader)
 {
     return(new TranslatedQueryExpressionTreeLeaf(QueryExpression.Translate(conventionReader), TableIdentifier.GetTableIdentifier(conventionReader)));
 }
Exemplo n.º 10
0
 public override QueryExpressionTree Translate(IConventionReader conventionReader)
 {
     return(new QueryExpressionTreeOrBranch(Nodes.Select(x => x.Translate(conventionReader)).ToArray()));
 }
Exemplo n.º 11
0
 public static AliasedSqlSubQuery Create <T>(string alias, IConventionReader conventionReader)
 {
     return(Create(alias, typeof(T), conventionReader));
 }
Exemplo n.º 12
0
 public InMemoryDatabase(IConventionReader conventionReader, IEntityMapper entityMapper)
 {
     ConventionReader = conventionReader;
     EntityMapper     = entityMapper;
 }
Exemplo n.º 13
0
 public IdPropertyComparer(IConventionReader conventionReader)
 {
     _conventionReader = conventionReader;
 }
Exemplo n.º 14
0
 public string GetTableIdentifier(IConventionReader conventionReader)
 {
     return _alias ?? conventionReader.GetTableName(_type);
 }
Exemplo n.º 15
0
 public override QueryExpressionTree Translate(IConventionReader conventionReader)
 {
     return new QueryExpressionTreeAndBranch(Nodes.Select(x => x.Translate(conventionReader)).ToArray());
 }
Exemplo n.º 16
0
 public ObjectCountExecutor(ISqlGenerator sqlGenerator, IConventionReader conventionReader, IDbCommandExecutor dbCommandExecutor)
 {
     _sqlGenerator      = sqlGenerator;
     _conventionReader  = conventionReader;
     _dbCommandExecutor = dbCommandExecutor;
 }
Exemplo n.º 17
0
 public EntityMapper(IConventionReader conventionReader)
 {
     _conventionReader = conventionReader;
     _entityCache      = new EntityCache(_conventionReader);
 }
Exemplo n.º 18
0
 public abstract QueryExpressionTree Translate(IConventionReader conventionReader);
Exemplo n.º 19
0
 public EntityCache(IConventionReader conventionReader)
 {
     _conventionReader   = conventionReader;
     _idPropertyComparer = new IdPropertyComparer <object>(_conventionReader);
 }
Exemplo n.º 20
0
 public override QueryExpressionTree Translate(IConventionReader conventionReader)
 {
     return(this);
 }
Exemplo n.º 21
0
 public StaticSelectBuilder(ISqlQueryExecutor sqlQueryExecutor, IExpressionParser expressionParser, IConventionReader conventionReader)
 {
     _sqlQueryExecutor = sqlQueryExecutor;
     _expressionParser = expressionParser;
     _sqlQuery         = SqlQuery.Create <T>(conventionReader);
 }