6 instantiations of FragmentQuery
System.Data.Entity (6)
System\Data\Mapping\ViewGeneration\QueryRewriting\FragmentQuery.cs (4)
46
return new
FragmentQuery
(null /*label*/, fromVariable, new HashSet<MemberPath>(cellQuery.GetProjectedMembers()), whereClause);
57
return new
FragmentQuery
(label, null /* fromVariable */, new HashSet<MemberPath>(), whereClause);
62
return new
FragmentQuery
(null /* no name */, null /* no fromVariable*/, attrs, whereClause);
67
return new
FragmentQuery
(null /* no name */, null /* no fromVariable*/, new MemberPath[] { }, whereClause);
System\Data\Mapping\ViewGeneration\QueryRewriting\FragmentQueryProcessor.cs (1)
150
FragmentQuery derivedView = new
FragmentQuery
(String.Format(CultureInfo.InvariantCulture, "project({0})", view.Description), view.FromVariable,
System\Data\Mapping\ViewGeneration\QueryRewriting\QueryRewriter.cs (1)
692
FragmentQuery tileQuery = new
FragmentQuery
(fragmentQuery.Description, fragmentQuery.FromVariable,
220 references to FragmentQuery
System.Data.Entity (220)
System\Data\Mapping\ViewGeneration\BasicViewGenerator.cs (5)
34
internal BasicViewGenerator(MemberProjectionIndex projectedSlotMap, List<LeftCellWrapper> usedCells,
FragmentQuery
activeDomain,
52
private
FragmentQuery
m_activeDomain;
655
FragmentQuery
intersection = LeftQP.Intersect(n1.RightFragmentQuery, n2.RightFragmentQuery);
680
FragmentQuery
n1Active = LeftQP.Intersect(n1.LeftFragmentQuery, m_activeDomain);
681
FragmentQuery
n2Active = LeftQP.Intersect(n2.LeftFragmentQuery, m_activeDomain);
System\Data\Mapping\ViewGeneration\QueryRewriting\FragmentQuery.cs (9)
41
public static
FragmentQuery
Create(BoolExpression fromVariable, CellQuery cellQuery)
49
public static
FragmentQuery
Create(string label, RoleBoolean roleBoolean, CellQuery cellQuery)
60
public static
FragmentQuery
Create(IEnumerable<MemberPath> attrs, BoolExpression whereClause)
65
public static
FragmentQuery
Create(BoolExpression whereClause)
133
internal static IEqualityComparer<
FragmentQuery
> GetEqualityComparer(FragmentQueryProcessor qp)
143
private class FragmentQueryEqualityComparer : IEqualityComparer<
FragmentQuery
>
155
public bool Equals(
FragmentQuery
x,
FragmentQuery
y)
167
public int GetHashCode(
FragmentQuery
q)
System\Data\Mapping\ViewGeneration\QueryRewriting\FragmentQueryProcessor.cs (23)
25
internal class FragmentQueryProcessor : TileQueryProcessor<
FragmentQuery
>
49
internal override
FragmentQuery
Union(
FragmentQuery
q1,
FragmentQuery
q2)
56
return
FragmentQuery
.Create(attributes, condition);
59
internal bool IsDisjointFrom(
FragmentQuery
q1,
FragmentQuery
q2)
64
internal bool IsContainedIn(
FragmentQuery
q1,
FragmentQuery
q2)
69
internal bool IsEquivalentTo(
FragmentQuery
q1,
FragmentQuery
q2)
75
internal override
FragmentQuery
Intersect(
FragmentQuery
q1,
FragmentQuery
q2)
82
return
FragmentQuery
.Create(attributes, condition);
85
internal override
FragmentQuery
Difference(
FragmentQuery
qA,
FragmentQuery
qB)
87
return
FragmentQuery
.Create(qA.Attributes, BoolExpression.CreateAndNot(qA.Condition, qB.Condition));
90
internal override bool IsSatisfiable(
FragmentQuery
query)
109
internal override
FragmentQuery
CreateDerivedViewBySelectingConstantAttributes(
FragmentQuery
view)
150
FragmentQuery
derivedView = new FragmentQuery(String.Format(CultureInfo.InvariantCulture, "project({0})", view.Description), view.FromVariable,
System\Data\Mapping\ViewGeneration\QueryRewriting\QueryRewriter.cs (120)
50
RewritingProcessor<Tile<
FragmentQuery
>> _qp;
54
List<
FragmentQuery
> _fragmentQueries = new List<
FragmentQuery
>();
55
List<Tile<
FragmentQuery
>> _views = new List<Tile<
FragmentQuery
>>();
57
FragmentQuery
_domainQuery;
59
HashSet<
FragmentQuery
> _usedViews = new HashSet<
FragmentQuery
>();
71
static Tile<
FragmentQuery
> TrueViewSurrogate = CreateTile(
FragmentQuery
.Create(BoolExpression.True));
87
_qp = new RewritingProcessor<Tile<
FragmentQuery
>>(new DefaultTileProcessor<
FragmentQuery
>(context.LeftFragmentQP));
94
FragmentQuery
query = leftCellWrapper.FragmentQuery;
95
Tile<
FragmentQuery
> tile = CreateTile(query);
106
_usedViews = new HashSet<
FragmentQuery
>();
198
private IEnumerable<
FragmentQuery
> FragmentQueries
271
Tile<
FragmentQuery
> caseRewriting;
272
HashSet<
FragmentQuery
> outputUsedViews = new HashSet<
FragmentQuery
>();
279
CellTreeNode cellTree = TileToCellTree((Tile<
FragmentQuery
>)caseRewriting, _context);
291
foreach (
FragmentQuery
query in _fragmentQueries)
299
internal
FragmentQuery
GetDomainQuery(IEnumerable<
FragmentQuery
> fragmentQueries, EdmType generatedType)
328
return
FragmentQuery
.Create(_keyAttributes, domainQueryCondition);
336
return
FragmentQuery
.Create(_keyAttributes, exposedRegionCondition);
341
private bool AddRewritingToCaseStatement(Tile<
FragmentQuery
> rewriting, CaseStatement caseStatement, MemberPath currentPath, Constant domainValue)
372
whenCondition = TileToBoolExpr((Tile<
FragmentQuery
>)rewriting);
388
HashSet<
FragmentQuery
> outputUsedViews,
405
Tile<
FragmentQuery
> rewriting;
494
HashSet<
FragmentQuery
> outputUsedViews)
509
Tile<
FragmentQuery
> unionCaseRewriting = null;
533
FragmentQuery
memberConditionQuery = CreateMemberConditionQuery(currentPath, domainValue);
535
Tile<
FragmentQuery
> caseRewriting;
602
CellTreeNode rightDomainQuery, Tile<
FragmentQuery
> unionCaseRewriting)
613
FragmentQuery
configurationNeedsDefault = _context.RightFragmentQP.Difference(rightDomainQuery.RightFragmentQuery, unionTree.RightFragmentQuery);
634
private BoolExpression GetTopLevelWhereClause(HashSet<
FragmentQuery
> outputUsedViews)
642
Tile<
FragmentQuery
> topLevelRewriting;
659
internal void EnsureExtentIsFullyMapped(HashSet<
FragmentQuery
> outputUsedViews)
690
FragmentQuery
fragmentQuery = leftCellWrapper.FragmentQuery;
692
FragmentQuery
tileQuery = new FragmentQuery(fragmentQuery.Description, fragmentQuery.FromVariable,
694
Tile<
FragmentQuery
> noNullToAvoid = CreateTile(
FragmentQuery
.Create(_keyAttributes, BoolExpression.CreateNot(fragmentQuery.Condition)));
695
Tile<
FragmentQuery
> noNullRewriting;
709
foreach (Tile<
FragmentQuery
> toFill in _views)
711
Tile<
FragmentQuery
> rewriting;
712
Tile<
FragmentQuery
> toAvoid = CreateTile(
FragmentQuery
.Create(_keyAttributes, BoolExpression.CreateNot(toFill.Query.Condition)));
805
HashSet<
FragmentQuery
> outputUsedViews, out Tile<
FragmentQuery
> rewriting)
815
HashSet<
FragmentQuery
> outputUsedViews, out Tile<
FragmentQuery
> rewriting,
828
out Tile<
FragmentQuery
> rewriting, out IEnumerable<MemberPath> notCoveredAttributes)
830
Tile<
FragmentQuery
> toFill = CreateTile(
FragmentQuery
.Create(attributes, whereClause));
832
Tile<
FragmentQuery
> toAvoid = CreateTile(
FragmentQuery
.Create(_keyAttributes, BoolExpression.CreateNot(whereClause)));
841
private bool RewriteQuery(Tile<
FragmentQuery
> toFill, Tile<
FragmentQuery
> toAvoid, out Tile<
FragmentQuery
> rewriting, out IEnumerable<MemberPath> notCoveredAttributes,
846
FragmentQuery
toFillQuery = toFill.Query;
854
IEnumerable<Tile<
FragmentQuery
>> relevantViews = GetRelevantViews(toFillQuery, isRelaxed);
855
FragmentQuery
originalToFillQuery = toFillQuery;
857
if (!RewriteQueryCached(CreateTile(
FragmentQuery
.Create(toFillQuery.Condition)), toAvoid, relevantViews, out rewriting))
862
toFillQuery =
FragmentQuery
.Create(toFillQuery.Attributes, BoolExpression.CreateAndNot(toFillQuery.Condition, rewriting.Query.Condition));
864
!RewriteQueryCached(CreateTile(
FragmentQuery
.Create(toFillQuery.Condition)), toAvoid, relevantViews, out rewriting))
883
Dictionary<MemberPath,
FragmentQuery
> attributeConditions = new Dictionary<MemberPath,
FragmentQuery
>();
899
FragmentQuery
remainingCondition;
902
attributeConditions[attribute] =
FragmentQuery
.Create(BoolExpression.CreateAndNot(toFillQuery.Condition, remainingCondition.Condition));
921
private bool RewriteQueryCached(Tile<
FragmentQuery
> toFill, Tile<
FragmentQuery
> toAvoid,
922
IEnumerable<Tile<
FragmentQuery
>> views, out Tile<
FragmentQuery
> rewriting)
940
private bool CoverAttributes(ref Tile<
FragmentQuery
> rewriting,
FragmentQuery
toFillQuery,
941
Dictionary<MemberPath,
FragmentQuery
> attributeConditions)
944
HashSet<
FragmentQuery
> usedViews = new HashSet<
FragmentQuery
>(rewriting.GetNamedQueries());
948
foreach (
FragmentQuery
view in usedViews)
960
Tile<
FragmentQuery
> attributeTile = null;
961
foreach (
FragmentQuery
view in _fragmentQueries)
990
private bool CoverAttribute(MemberPath projectedAttribute,
FragmentQuery
view, Dictionary<MemberPath,
FragmentQuery
> attributeConditions,
FragmentQuery
toFillQuery)
992
FragmentQuery
currentAttributeCondition;
995
currentAttributeCondition =
FragmentQuery
.Create(BoolExpression.CreateAndNot(currentAttributeCondition.Condition, view.Condition));
1010
private IEnumerable<Tile<
FragmentQuery
>> GetRelevantViews(
FragmentQuery
query, bool isRelaxed)
1028
Tile<
FragmentQuery
> unionOfConnectedViews = null;
1029
List<Tile<
FragmentQuery
>> connectedViews = new List<Tile<
FragmentQuery
>>();
1030
Tile<
FragmentQuery
> firstTrueView = null;
1031
foreach (Tile<
FragmentQuery
> tile in _views)
1055
Tile<
FragmentQuery
> unionTile = null;
1056
foreach (
FragmentQuery
view in _fragmentQueries)
1083
private HashSet<
FragmentQuery
> GetUsedViewsAndRemoveTrueSurrogate(ref Tile<
FragmentQuery
> rewriting)
1085
HashSet<
FragmentQuery
> usedViews = new HashSet<
FragmentQuery
>(rewriting.GetNamedQueries());
1094
Tile<
FragmentQuery
> unionTile = null;
1095
IEnumerable<
FragmentQuery
> usedFollowedByUnusedViews = usedViews.Concat(_fragmentQueries);
1096
foreach (
FragmentQuery
view in usedFollowedByUnusedViews)
1118
return
FragmentQuery
.CreateMemberCondition(path, domainValue, _domainMap);
1121
private
FragmentQuery
CreateMemberConditionQuery(MemberPath currentPath, Constant domainValue)
1126
internal static
FragmentQuery
CreateMemberConditionQuery(MemberPath currentPath, Constant domainValue,
1130
BoolExpression domainWhereClause =
FragmentQuery
.CreateMemberCondition(currentPath, domainValue, domainMap);
1139
return
FragmentQuery
.Create(attributes, domainWhereClause);
1142
private static TileNamed<
FragmentQuery
> CreateTile(
FragmentQuery
query)
1144
return new TileNamed<
FragmentQuery
>(query);
1183
internal static CellTreeNode TileToCellTree(Tile<
FragmentQuery
> tile, ViewgenContext context)
1187
FragmentQuery
view = ((TileNamed<
FragmentQuery
>)tile).NamedQuery;
1206
private static BoolExpression TileToBoolExpr(Tile<
FragmentQuery
> tile)
1211
FragmentQuery
view = ((TileNamed<
FragmentQuery
>)tile).NamedQuery;
1250
private Set<MemberPath> GetVariables(
FragmentQuery
query)
1261
private bool IsTrue(
FragmentQuery
query)
1263
return !_context.LeftFragmentQP.IsSatisfiable(
FragmentQuery
.Create(BoolExpression.CreateNot(query.Condition)));
1267
private void PrintStatistics(RewritingProcessor<Tile<
FragmentQuery
>> qp)
System\Data\Mapping\ViewGeneration\QueryRewriting\RewritingValidator.cs (15)
136
private bool CheckEquivalence(
FragmentQuery
cQuery,
FragmentQuery
sQuery, BoolExpression inExtentCondition,
139
FragmentQuery
cMinusSx = _viewgenContext.RightFragmentQP.Difference(cQuery, sQuery);
140
FragmentQuery
sMinusCx = _viewgenContext.RightFragmentQP.Difference(sQuery, cQuery);
143
FragmentQuery
cMinusS =
FragmentQuery
.Create(BoolExpression.CreateAnd(cMinusSx.Condition, inExtentCondition));
144
FragmentQuery
sMinusC =
FragmentQuery
.Create(BoolExpression.CreateAnd(sMinusCx.Condition, inExtentCondition));
205
FragmentQuery
memberConditionQuery = QueryRewriter.CreateMemberConditionQuery(column, domainValue, _keyAttributes, _domainMap);
206
Tile<
FragmentQuery
> rewriting;
258
FragmentQuery
cCombinedQuery =
FragmentQuery
.Create(cWhereClause);
326
private static
FragmentQuery
AddNullConditionOnCSideFragment(LeftCellWrapper wrapper, MemberPath member, MemberMaps memberMaps)
343
return
FragmentQuery
.Create(resultingExpr);
359
FragmentQuery
cFragment = AddNullConditionOnCSideFragment(wrapper, column, _viewgenContext.MemberMaps);
System\Data\Mapping\ViewGeneration\Structures\CellTreeNode.cs (2)
55
internal abstract
FragmentQuery
LeftFragmentQuery { get; }
57
internal abstract
FragmentQuery
RightFragmentQuery { get; }
System\Data\Mapping\ViewGeneration\Structures\LeafCellTreeNode.cs (6)
34
m_rightFragmentQuery =
FragmentQuery
.Create(
39
internal LeafCellTreeNode(ViewgenContext context, LeftCellWrapper cellWrapper,
FragmentQuery
rightFragmentQuery)
53
private
FragmentQuery
m_leftFragmentQuery;
54
private
FragmentQuery
m_rightFragmentQuery;
69
internal override
FragmentQuery
LeftFragmentQuery { get { return m_cellWrapper.FragmentQuery; } }
71
internal override
FragmentQuery
RightFragmentQuery
System\Data\Mapping\ViewGeneration\Structures\LeftCellWrapper.cs (4)
56
private
FragmentQuery
m_leftFragmentQuery; // Fragment query corresponding to the left cell query of the cell
68
FragmentQuery
fragmentQuery,
81
FragmentQuery
fragmentQuery,
91
internal
FragmentQuery
FragmentQuery
System\Data\Mapping\ViewGeneration\Structures\OpCellTreeNode.cs (7)
61
private
FragmentQuery
m_leftFragmentQuery;
62
private
FragmentQuery
m_rightFragmentQuery;
70
internal override
FragmentQuery
LeftFragmentQuery
82
internal override
FragmentQuery
RightFragmentQuery
591
private static
FragmentQuery
GenerateFragmentQuery(IEnumerable<CellTreeNode> children, bool isLeft, ViewgenContext context, CellTreeOpType OpType)
594
FragmentQuery
fragmentQuery = isLeft ? children.First().LeftFragmentQuery : children.First().RightFragmentQuery;
599
FragmentQuery
nextQuery = isLeft ? child.LeftFragmentQuery : child.RightFragmentQuery;
System\Data\Mapping\ViewGeneration\Validation\ErrorPatternMatcher.cs (14)
24
delegate bool LCWComparer(
FragmentQuery
query1,
FragmentQuery
query2);
348
FragmentQuery
rightFragmentQuery1 = CreateRightFragmentQuery(fragment1);
349
FragmentQuery
rightFragmentQuery2 = CreateRightFragmentQuery(fragment2);
693
private bool CompareC(ComparisonOP op, ViewgenContext context, LeftCellWrapper leftWrapper1, LeftCellWrapper leftWrapper2,
FragmentQuery
rightQuery1,
FragmentQuery
rightQuery2)
698
private bool CompareS(ComparisonOP op, ViewgenContext context, LeftCellWrapper leftWrapper1, LeftCellWrapper leftWrapper2,
FragmentQuery
rightQuery1,
FragmentQuery
rightQuery2)
703
private bool Compare(bool lookingForC, ComparisonOP op, ViewgenContext context, LeftCellWrapper leftWrapper1, LeftCellWrapper leftWrapper2,
FragmentQuery
rightQuery1,
FragmentQuery
rightQuery2)
747
FragmentQuery
rightFragmentQuery1 = CreateRightFragmentQuery(wrapper1);
748
FragmentQuery
rightFragmentQuery2 = CreateRightFragmentQuery(wrapper2);
753
private
FragmentQuery
CreateRightFragmentQuery(LeftCellWrapper wrapper)
755
return
FragmentQuery
.Create(wrapper.OnlyInputCell.CellLabel.ToString(), wrapper.CreateRoleBoolean(), wrapper.OnlyInputCell.GetRightQuery(m_viewgenContext.ViewTarget));
System\Data\Mapping\ViewGeneration\Validation\ForeignConstraint.cs (2)
441
FragmentQuery
cNodeQuery =
FragmentQuery
.Create(pNode.RightFragmentQuery.Attributes, endCondition);
System\Data\Mapping\ViewGeneration\ViewgenContext.cs (13)
51
private Dictionary<
FragmentQuery
, Tile<
FragmentQuery
>> m_rewritingCache;
88
m_rewritingCache = new Dictionary<
FragmentQuery
, Tile<
FragmentQuery
>>(
89
FragmentQuery
.GetEqualityComparer(m_leftFragmentQP));
225
internal bool TryGetCachedRewriting(
FragmentQuery
query, out Tile<
FragmentQuery
> rewriting)
231
internal void SetCachedRewriting(
FragmentQuery
query, Tile<
FragmentQuery
> rewriting)
310
FragmentQuery
leftFragmentQuery =
FragmentQuery
.Create(fromVariable, left);
311
FragmentQuery
rightFragmentQuery =
FragmentQuery
.Create(fromVariable, right);