public SingleParameterLambdaState(ParameterExpression parameter) { _singleEntityName = parameter.Name; var entityMapping = DataEntityMapping.GetEntityMapping(parameter.Type); _singleEntityMap = entityMapping.GetRelationMap(); }
public RelateParameterLambdaState(ParameterExpression parameter, LambdaState state) { var entityMapping = DataEntityMapping.GetEntityMapping(parameter.Type); _singleEntityName = parameter.Name; _singleEntityMap = entityMapping.GetRelationMap(); _state = state; }
public SingleParameterLambdaState(ParameterExpression parameter) { this.singleEntityName = parameter.Name; Type type = parameter.Type; DataEntityMapping entityMapping = DataEntityMapping.GetEntityMapping(type); this.singleEntityMap = entityMapping.GetRelationMap(); }
public RelationMap GetRelationMap() { if (this.relationMap == null) { lock (joinLock) { if (this.relationMap == null) { this.relationMap = new RelationMap(this); } } } return(this.relationMap); }
public virtual QueryCommand SelectInsert(DataContext context, InsertSelector selector, DataEntityMapping mapping, QueryExpression query, OrderExpression order, bool distinct) { RelationMap relationMap = mapping.GetRelationMap(); CommandData commandData; CreateSqlState state = new CreateSqlState(context); if (mapping.HasJoinRelateModel) { QueryExpression subQuery = null; QueryExpression mainQuery = null; OrderExpression subOrder = null; OrderExpression mainOrder = null; if (query != null) { if (query.MutliQuery) { mainQuery = query; } else { subQuery = query; } } if (order != null) { if (order.MutliOrder) { mainOrder = order; } else { subOrder = order; } } List <IJoinModel> models = relationMap.CreateJoinModels(subQuery, subOrder); commandData = _factory.CreateSelectInsertCommand(selector, models, mainQuery, mainOrder, distinct, state); } else { commandData = _factory.CreateSelectInsertCommand(selector, mapping, query, order, distinct, state); } DbCommand command = commandData.CreateCommand(this, state); QueryCommand queryCommand = new QueryCommand() { Command = command }; return(queryCommand); }
public virtual QueryCommand QueryEntityData(DataContext context, DataEntityMapping mapping, ISelector selector, QueryExpression query, OrderExpression order, bool distinct, Region region) { RelationMap relationMap = mapping.GetRelationMap(); if (selector == null) { selector = relationMap.GetDefaultSelector(); } CreateSqlState state = new CreateSqlState(context); CommandData commandData = _factory.CreateSelectDataCommand(mapping, relationMap, selector, query, order, distinct, region, state); DbCommand command = commandData.CreateCommand(this, state); QueryState queryState = new QueryState(); queryState.SetRelationMap(relationMap); queryState.SetSelector(selector); QueryCommand queryCommand = new QueryCommand() { Command = command, InnerPage = commandData.InnerPage, State = queryState }; return(queryCommand); }
public void SetRelationMap(RelationMap relationMap) { this.relationMap = relationMap; }
public void SetRelationMap(RelationMap relationMap) { _relationMap = relationMap; }