Beispiel #1
0
        private FromElement CreateCollectionJoin(JoinSequence collectionJoinSequence, string tableAlias)
        {
            string      text        = _queryableCollection.TableName;
            IASTNode    ast         = CreateFromElement(text);
            FromElement destination = (FromElement)ast;
            IType       elementType = _queryableCollection.ElementType;

            if (elementType.IsCollectionType)
            {
                throw new SemanticException("Collections of collections are not supported!");
            }

            destination.InitializeCollection(_fromClause, _classAlias, tableAlias);
            destination.Type = HqlSqlWalker.JOIN_FRAGMENT;              // Tag this node as a JOIN.
            destination.SetIncludeSubclasses(false);                    // Don't include subclasses in the join.
            destination.CollectionJoin = true;                          // This is a clollection join.
            destination.JoinSequence   = collectionJoinSequence;
            destination.SetOrigin(_origin, false);
            destination.CollectionTableAlias = tableAlias;
            //		origin.addDestination( destination );
            // This was the cause of HHH-242
            //		origin.setType( FROM_FRAGMENT );			// Set the parent node type so that the AST is properly formed.
            _origin.Text           = "";                                // The destination node will have all the FROM text.
            _origin.CollectionJoin = true;                              // The parent node is a collection join too (voodoo - see JoinProcessor)
            _fromClause.AddCollectionJoinFromElementByPath(_path, destination);
            _fromClause.Walker.AddQuerySpaces(_queryableCollection.CollectionSpaces);
            return(destination);
        }
Beispiel #2
0
 private FromElement InitializeJoin(
     string path,
     FromElement destination,
     JoinSequence joinSequence,
     string[] columns,
     FromElement origin,
     bool manyToMany)
 {
     destination.Type         = HqlSqlWalker.JOIN_FRAGMENT;
     destination.JoinSequence = joinSequence;
     destination.Columns      = columns;
     destination.SetOrigin(origin, manyToMany);
     _fromClause.AddJoinByPathMap(path, destination);
     return(destination);
 }
		private FromElement InitializeJoin(
						string path,
						FromElement destination,
						JoinSequence joinSequence,
						string[] columns,
						FromElement origin,
						bool manyToMany)
		{
			destination.Type = HqlSqlWalker.JOIN_FRAGMENT;
			destination.JoinSequence = joinSequence;
			destination.Columns = columns;
			destination.SetOrigin(origin, manyToMany);
			_fromClause.AddJoinByPathMap(path, destination);
			return destination;
		}