コード例 #1
0
        private static PropertyRefList GetIdentityProperties(EntityType type)
        {
            PropertyRefList keyProperties = PropertyPushdownHelper.GetKeyProperties(type);

            keyProperties.Add((PropertyRef)EntitySetIdPropertyRef.Instance);
            return(keyProperties);
        }
コード例 #2
0
        /// <summary>
        ///     The driver.
        ///     Walks the tree, and "pushes" down information about required properties
        ///     to every node and Var in the tree.
        /// </summary>
        /// <param name="itree"> The query tree </param>
        /// <param name="varPropertyRefs"> List of desired properties from each Var </param>
        /// <param name="nodePropertyRefs"> List of desired properties from each node </param>
        internal static void Process(
            Command itree, out Dictionary<Var, PropertyRefList> varPropertyRefs, out Dictionary<Node, PropertyRefList> nodePropertyRefs)
        {
            var pph = new PropertyPushdownHelper();
            pph.Process(itree.Root);

            varPropertyRefs = pph.m_varPropertyRefMap;
            nodePropertyRefs = pph.m_nodePropertyRefMap;
        }
コード例 #3
0
        /// <summary>
        ///     The driver.
        ///     Walks the tree, and "pushes" down information about required properties
        ///     to every node and Var in the tree.
        /// </summary>
        /// <param name="itree"> The query tree </param>
        /// <param name="varPropertyRefs"> List of desired properties from each Var </param>
        /// <param name="nodePropertyRefs"> List of desired properties from each node </param>
        internal static void Process(
            Command itree, out Dictionary <Var, PropertyRefList> varPropertyRefs, out Dictionary <Node, PropertyRefList> nodePropertyRefs)
        {
            var pph = new PropertyPushdownHelper();

            pph.Process(itree.Root);

            varPropertyRefs  = pph.m_varPropertyRefMap;
            nodePropertyRefs = pph.m_nodePropertyRefMap;
        }
コード例 #4
0
        public override void Visit(GetEntityRefOp op, System.Data.Entity.Core.Query.InternalTrees.Node n)
        {
            ScalarOp op1 = n.Child0.Op as ScalarOp;

            System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert(op1 != null, "input to GetEntityRefOp is not a ScalarOp?");
            PropertyRefList identityProperties = PropertyPushdownHelper.GetIdentityProperties(TypeHelpers.GetEdmType <EntityType>(op1.Type));

            this.AddPropertyRefs(n.Child0, identityProperties);
            this.VisitNode(n.Child0);
        }
コード例 #5
0
        internal static void Process(
            Command itree,
            out Dictionary <Var, PropertyRefList> varPropertyRefs,
            out Dictionary <System.Data.Entity.Core.Query.InternalTrees.Node, PropertyRefList> nodePropertyRefs)
        {
            PropertyPushdownHelper propertyPushdownHelper = new PropertyPushdownHelper();

            propertyPushdownHelper.Process(itree.Root);
            varPropertyRefs  = propertyPushdownHelper.m_varPropertyRefMap;
            nodePropertyRefs = propertyPushdownHelper.m_nodePropertyRefMap;
        }
コード例 #6
0
        public override void Visit(ComparisonOp op, System.Data.Entity.Core.Query.InternalTrees.Node n)
        {
            TypeUsage type = (n.Child0.Op as ScalarOp).Type;

            if (!TypeUtils.IsStructuredType(type))
            {
                this.VisitChildren(n);
            }
            else if (TypeSemantics.IsRowType(type) || TypeSemantics.IsReferenceType(type))
            {
                this.VisitDefault(n);
            }
            else
            {
                System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert(TypeSemantics.IsEntityType(type), "unexpected childOpType?");
                PropertyRefList identityProperties = PropertyPushdownHelper.GetIdentityProperties(TypeHelpers.GetEdmType <EntityType>(type));
                foreach (System.Data.Entity.Core.Query.InternalTrees.Node child in n.Children)
                {
                    this.AddPropertyRefs(child, identityProperties);
                }
                this.VisitChildren(n);
            }
        }