private static void ValidateLhs(FromReferenceNode lhs)
        {
            // make sure the lhs is "assignable"...
            if (!lhs.IsResolved)
            {
                throw new NotSupportedException("cannot validate assignablity of unresolved node");
            }

            if (lhs.DataType.IsCollectionType)
            {
                throw new QueryException("collections not assignable in update statements");
            }
            else if (lhs.DataType.IsComponentType)
            {
                throw new QueryException("Components currently not assignable in update statements");
            }
            else if (lhs.DataType.IsEntityType)
            {
                // currently allowed...
            }

            // TODO : why aren't these the same?
            if (lhs.GetImpliedJoin() != null || lhs.FromElement.IsImplied)
            {
                throw new QueryException("Implied join paths are not assignable in update statements");
            }
        }
Example #2
0
        private FromElement EvaluateFromElementPath(string path, string classAlias)
        {
            FromReferenceNode pathNode = (FromReferenceNode)PathHelper.ParsePath(path, _fromClause.ASTFactory);

            pathNode.RecursiveResolve(FromReferenceNode.RootLevel, // This is the root level node.
                                      false,                       // Generate an explicit from clause at the root.
                                      classAlias,
                                      null
                                      );

            if (pathNode.GetImpliedJoin() != null)
            {
                return(pathNode.GetImpliedJoin());
            }
            else
            {
                return(pathNode.FromElement);
            }
        }
		private static void ValidateLhs(FromReferenceNode lhs)
		{
			// make sure the lhs is "assignable"...
			if (!lhs.IsResolved)
			{
				throw new NotSupportedException("cannot validate assignablity of unresolved node");
			}

			if (lhs.DataType.IsCollectionType)
			{
				throw new QueryException("collections not assignable in update statements");
			}
			else if (lhs.DataType.IsComponentType)
			{
				throw new QueryException("Components currently not assignable in update statements");
			}
			else if (lhs.DataType.IsEntityType)
			{
				// currently allowed...
			}

			// TODO : why aren't these the same?
			if (lhs.GetImpliedJoin() != null || lhs.FromElement.IsImplied)
			{
				throw new QueryException("Implied join paths are not assignable in update statements");
			}
		}