Exemplo n.º 1
0
 public IList <IASTNode> GetCollectionFetches()
 {
     return(ASTUtil.CollectChildren(this, CollectionFetchPredicate));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Returns the list of from elements that will be part of the result set.
 /// </summary>
 /// <returns>the list of from elements that will be part of the result set.</returns>
 public IList <IASTNode> GetProjectionList()
 {
     return(ASTUtil.CollectChildren(this, ProjectionListPredicate));
 }
Exemplo n.º 3
0
 public IList <IASTNode> GetExplicitFromElements()
 {
     return(ASTUtil.CollectChildren(this, ExplicitFromPredicate));
 }
        public AssignmentSpecification(IASTNode eq, IQueryable persister)
        {
            if (eq.Type != HqlSqlWalker.EQ)
            {
                throw new QueryException("assignment in set-clause not associated with equals");
            }

            _eq      = eq;
            _factory = persister.Factory;

            // Needed to bump this up to DotNode, because that is the only thing which currently
            // knows about the property-ref path in the correct format; it is either this, or
            // recurse over the DotNodes constructing the property path just like DotNode does
            // internally
            DotNode lhs;

            try
            {
                lhs = (DotNode)eq.GetFirstChild();
            }
            catch (InvalidCastException e)
            {
                throw new QueryException(
                          string.Format("Left side of assigment should be a case sensitive property or a field (depending on mapping); found '{0}'", eq.GetFirstChild()), e);
            }
            var rhs = (SqlNode)lhs.NextSibling;

            ValidateLhs(lhs);

            string propertyPath = lhs.PropertyPath;
            var    temp         = new HashedSet <string>();
            // yuck!
            var usep = persister as UnionSubclassEntityPersister;

            if (usep != null)
            {
                temp.AddAll(persister.ConstraintOrderedTableNameClosure);
            }
            else
            {
                temp.Add(persister.GetSubclassTableName(persister.GetSubclassPropertyTableNumber(propertyPath)));
            }
            _tableNames = new ImmutableSet <string>(temp);

            if (rhs == null)
            {
                _hqlParameters = new IParameterSpecification[0];
            }
            else if (IsParam(rhs))
            {
                _hqlParameters = new[] { ((ParameterNode)rhs).HqlParameterSpecification };
            }
            else
            {
                var parameterList = ASTUtil.CollectChildren(rhs, IsParam);
                _hqlParameters = new IParameterSpecification[parameterList.Count];
                int i = 0;
                foreach (ParameterNode parameterNode in parameterList)
                {
                    _hqlParameters[i++] = parameterNode.HqlParameterSpecification;
                }
            }
        }
Exemplo n.º 5
0
 internal IList <FromElement> GetCollectionFetchesTyped()
 {
     return(ASTUtil.CollectChildren <FromElement>(this, CollectionFetchPredicate));
 }
Exemplo n.º 6
0
 internal IList <FromElement> GetExplicitFromElementsTyped()
 {
     return(ASTUtil.CollectChildren <FromElement>(this, ExplicitFromPredicate));
 }
Exemplo n.º 7
0
 internal IList <FromElement> GetProjectionListTyped()
 {
     return(ASTUtil.CollectChildren <FromElement>(this, ProjectionListPredicate));
 }
Exemplo n.º 8
0
 //6.0 TODO: Replace with Typed version below
 /// <summary>
 /// Returns the list of from elements in order.
 /// </summary>
 /// <returns>The list of from elements (instances of FromElement).</returns>
 public IList <IASTNode> GetFromElements()
 {
     return(ASTUtil.CollectChildren <IASTNode>(this, FromElementPredicate));
 }