Package org.jinq.jpa.jpqlquery

Examples of org.jinq.jpa.jpqlquery.From$FromNavigationalLinksLeftOuterJoin


                  return null;
            }
           
            // Create the query
            SelectFromWhere<?> query = new SelectFromWhere<>();
            From from = From.forNavigationalLinks(
                  new ReadFieldExpression(nLinkBase.getOnlyColumn(), linkName));
            query.cols = ColumnExpressions.singleColumn(
                  new SimpleRowReader<>(), new FromAliasExpression(from));
            query.froms.add(from);
            return query;
View Full Code Here


   }
  

   private boolean isLeftOuterJoinCompatible(SelectFromWhere<?> toMerge)
   {
      From from = toMerge.froms.get(0);
      if (!(from instanceof From.FromNavigationalLinks))
         return false;
      Expression navLink = ((From.FromNavigationalLinks)from).links;
      while (!(navLink instanceof FromAliasExpression))
      {
View Full Code Here

            // Check if the subquery is simply a stream of all of a certain entity
            if (JoinTransform.isSimpleFrom(returnExpr))
            {
               SelectFromWhere<?> toMerge = (SelectFromWhere<?>)returnExpr;
               SelectFromWhere<U> toReturn = (SelectFromWhere<U>)sfw.shallowCopy();
               From from = toMerge.froms.get(0);
               if (!isLeftOuterJoinCompatible(toMerge))
                  throw new QueryTransformException("Left outer join must be applied to a navigational link");
               From.FromNavigationalLinksLeftOuterJoin outerJoinFrom = From.forNavigationalLinksLeftOuterJoin((From.FromNavigationalLinks)from);
               if (isChainedLink(outerJoinFrom.links))
               {
                  // The left outer join only applies to the end part of
                  // links. So we'll pull off the earlier part of the chain
                  // and make them a separate alias.
                  ReadFieldExpression outerLinks = (ReadFieldExpression)outerJoinFrom.links;
                  From baseFrom = From.forNavigationalLinks(outerLinks.base);
                  toReturn.froms.add(baseFrom);
                  outerJoinFrom.links = new ReadFieldExpression(new FromAliasExpression(baseFrom), outerLinks.field);
               }
               toReturn.froms.add(outerJoinFrom);
               rewriteFromAliases(toMerge, from, outerJoinFrom);
View Full Code Here

TOP

Related Classes of org.jinq.jpa.jpqlquery.From$FromNavigationalLinksLeftOuterJoin

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.