示例#1
0
        private void VisitPropertyOp(Op op, System.Data.Entity.Core.Query.InternalTrees.Node n, PropertyRef propertyRef)
        {
            PropertyRefList propertyRefs = new PropertyRefList();

            if (!TypeUtils.IsStructuredType(op.Type))
            {
                propertyRefs.Add(propertyRef);
            }
            else
            {
                PropertyRefList propertyRefList = this.GetPropertyRefList(n);
                if (propertyRefList.AllProperties)
                {
                    propertyRefs = propertyRefList;
                }
                else
                {
                    foreach (PropertyRef property in propertyRefList.Properties)
                    {
                        propertyRefs.Add(property.CreateNestedPropertyRef(propertyRef));
                    }
                }
            }
            this.AddPropertyRefs(n.Child0, propertyRefs);
            this.VisitChildren(n);
        }
示例#2
0
        private static PropertyRefList GetIdentityProperties(EntityType type)
        {
            PropertyRefList keyProperties = PropertyPushdownHelper.GetKeyProperties(type);

            keyProperties.Add((PropertyRef)EntitySetIdPropertyRef.Instance);
            return(keyProperties);
        }
示例#3
0
        public override void Visit(TreatOp op, System.Data.Entity.Core.Query.InternalTrees.Node n)
        {
            PropertyRefList propertyRefs = this.GetPropertyRefList(n).Clone();

            propertyRefs.Add((PropertyRef)TypeIdPropertyRef.Instance);
            this.AddPropertyRefs(n.Child0, propertyRefs);
            this.VisitChildren(n);
        }
示例#4
0
        /// <summary>
        ///     IsOfOp handling
        ///     Simply requests the "typeid" property from
        ///     the input. No other property is required
        /// </summary>
        /// <param name="op"> IsOf op </param>
        /// <param name="n"> Node to visit </param>
        public override void Visit(IsOfOp op, Node n)
        {
            // The only property I need from my child is the typeid property;
            var childProps = new PropertyRefList();

            childProps.Add(TypeIdPropertyRef.Instance);
            AddPropertyRefs(n.Child0, childProps);

            VisitChildren(n);
        }
示例#5
0
        internal PropertyRefList Clone()
        {
            PropertyRefList propertyRefList = new PropertyRefList(this.m_allProperties);

            foreach (PropertyRef key in this.m_propertyReferences.Keys)
            {
                propertyRefList.Add(key);
            }
            return(propertyRefList);
        }
        // <summary>
        // Create a clone of myself
        // </summary>
        // <returns> a clone of myself </returns>
        internal PropertyRefList Clone()
        {
            var newProps = new PropertyRefList(m_allProperties);

            foreach (var p in m_propertyReferences.Keys)
            {
                newProps.Add(p);
            }
            return(newProps);
        }
示例#7
0
        /// <summary>
        ///     Common handler for RelPropertyOp and PropertyOp.
        ///     Simply pushes down the desired set of properties to the child
        /// </summary>
        /// <param name="op"> the *propertyOp </param>
        /// <param name="n"> node tree corresponding to the Op </param>
        /// <param name="propertyRef"> the property reference </param>
        private void VisitPropertyOp(Op op, Node n, PropertyRef propertyRef)
        {
            var cdProps = new PropertyRefList();

            if (!TypeUtils.IsStructuredType(op.Type))
            {
                cdProps.Add(propertyRef);
            }
            else
            {
                // Get the list of properties my parent expects from me.
                var pdProps = GetPropertyRefList(n);

                // Ask my child (which is really my container type) for each of these
                // properties

                // If I've been asked for all my properties, then get the
                // corresponding flat list of properties from my children.
                // For now, however, simply ask for all properties in this case
                // What we really need to do is to get the "flattened" list of
                // properties from the input, and prepend each of these with
                // our property name. We don't have that info available, so
                // I'm taking the easier route.
                if (pdProps.AllProperties)
                {
                    cdProps = pdProps;
                }
                else
                {
                    foreach (var p in pdProps.Properties)
                    {
                        cdProps.Add(p.CreateNestedPropertyRef(propertyRef));
                    }
                }
            }

            // push down my expectations
            AddPropertyRefs(n.Child0, cdProps);
            VisitChildren(n);
        }
示例#8
0
        private static PropertyRefList GetKeyProperties(md.EntityType entityType)
        {
            var desiredProperties = new PropertyRefList();

            foreach (var p in entityType.KeyMembers)
            {
                var edmP = p as md.EdmProperty;
                PlanCompiler.Assert(edmP != null, "EntityType had non-EdmProperty key member?");
                var pRef = new SimplePropertyRef(edmP);
                desiredProperties.Add(pRef);
            }
            return(desiredProperties);
        }
示例#9
0
        private static PropertyRefList GetKeyProperties(EntityType entityType)
        {
            PropertyRefList propertyRefList = new PropertyRefList();

            foreach (EdmMember keyMember in entityType.KeyMembers)
            {
                EdmProperty edmProperty = keyMember as EdmProperty;
                System.Data.Entity.Core.Query.PlanCompiler.PlanCompiler.Assert(edmProperty != null, "EntityType had non-EdmProperty key member?");
                SimplePropertyRef simplePropertyRef = new SimplePropertyRef((EdmMember)edmProperty);
                propertyRefList.Add((PropertyRef)simplePropertyRef);
            }
            return(propertyRefList);
        }
示例#10
0
 // <summary>
 // Create a clone of myself
 // </summary>
 // <returns> a clone of myself </returns>
 internal PropertyRefList Clone()
 {
     var newProps = new PropertyRefList(m_allProperties);
     foreach (var p in m_propertyReferences.Keys)
     {
         newProps.Add(p);
     }
     return newProps;
 }
        /// <summary>
        ///     Common handler for RelPropertyOp and PropertyOp. 
        ///     Simply pushes down the desired set of properties to the child
        /// </summary>
        /// <param name="op"> the *propertyOp </param>
        /// <param name="n"> node tree corresponding to the Op </param>
        /// <param name="propertyRef"> the property reference </param>
        private void VisitPropertyOp(Op op, Node n, PropertyRef propertyRef)
        {
            var cdProps = new PropertyRefList();
            if (!TypeUtils.IsStructuredType(op.Type))
            {
                cdProps.Add(propertyRef);
            }
            else
            {
                // Get the list of properties my parent expects from me. 
                var pdProps = GetPropertyRefList(n);

                // Ask my child (which is really my container type) for each of these 
                // properties

                // If I've been asked for all my properties, then get the 
                // corresponding flat list of properties from my children.
                // For now, however, simply ask for all properties in this case
                // What we really need to do is to get the "flattened" list of
                // properties from the input, and prepend each of these with
                // our property name. We don't have that info available, so 
                // I'm taking the easier route.
                if (pdProps.AllProperties)
                {
                    cdProps = pdProps;
                }
                else
                {
                    foreach (var p in pdProps.Properties)
                    {
                        cdProps.Add(p.CreateNestedPropertyRef(propertyRef));
                    }
                }
            }

            // push down my expectations
            AddPropertyRefs(n.Child0, cdProps);
            VisitChildren(n);
        }
        /// <summary>
        ///     IsOfOp handling
        /// 
        ///     Simply requests the "typeid" property from
        ///     the input. No other property is required
        /// </summary>
        /// <param name="op"> IsOf op </param>
        /// <param name="n"> Node to visit </param>
        public override void Visit(IsOfOp op, Node n)
        {
            // The only property I need from my child is the typeid property;
            var childProps = new PropertyRefList();
            childProps.Add(TypeIdPropertyRef.Instance);
            AddPropertyRefs(n.Child0, childProps);

            VisitChildren(n);
        }
 private static PropertyRefList GetKeyProperties(md.EntityType entityType)
 {
     var desiredProperties = new PropertyRefList();
     foreach (var p in entityType.KeyMembers)
     {
         var edmP = p as md.EdmProperty;
         PlanCompiler.Assert(edmP != null, "EntityType had non-EdmProperty key member?");
         var pRef = new SimplePropertyRef(edmP);
         desiredProperties.Add(pRef);
     }
     return desiredProperties;
 }