Package ch.epfl.labos.iu.orm.query2

Examples of ch.epfl.labos.iu.orm.query2.ParameterLocation$LambdaCapturedArg


         if (from == null)
         {
            from = lambdaContext.joins.addFrom(link.joinInfo.get(0).toTableName);
            for (int n = 0; n < link.joinInfo.get(0).fromColumns.size(); n++)
            {
               SQLFragment where = new SQLFragment();
               String fromCol = link.joinInfo.get(0).fromColumns.get(n);
               String toCol = link.joinInfo.get(0).toColumns.get(n);
               int fromColIdx = base.reader.getColumnIndexForColumnName(fromCol);
               if (fromColIdx < 0) throw new TypedValueVisitorException("Cannot find column for navigational query: " + val);
               where.add("(");
               where.add(base.getColumn(fromColIdx));
               where.add(") = (");
               where.add(from);
               where.add("." + toCol);
               where.add(")");
               lambdaContext.joins.addWhere(where);
            }
            lambdaContext.joins.addCachedJoin(link.fromEntity, link.name, fromKey, from);
         }
         EntityManagerBackdoor em = lambdaContext.joins.getEntityManager();
         SQLColumnValues joinedEntity = new SQLColumnValues<T>(em.getReaderForEntity(link.toEntity));
         String []columnNames = em.getEntityColumnNames(link.toEntity);
         for (int n = 0; n < columnNames.length; n++)
         {
            SQLFragment fragment = new SQLFragment();
            fragment.add(from);
            fragment.add("." + columnNames[n]);
            joinedEntity.columns[n] = fragment;
         }
         return joinedEntity;
//         throw new TypedValueVisitorException("Unhandled N:1 or 1:1 navigational query:" + val);
      }
View Full Code Here


         {
            sfw.where.add(where);
         }
         else
         {
            SQLFragment sql = new SQLFragment("(");
            sql.add(sfw.where);
            sql.add(") AND (");
            sql.add(where);
            sql.add(")");
            sfw.where = sql;
         }
      }
View Full Code Here

   public SQLColumnValues(SQLReader<T> reader)
   {
      this.reader = reader;
      columns = new SQLFragment[reader.getNumColumns()];
      for (int n = 0; n < columns.length; n++)
         columns[n] = new SQLFragment();
   }
View Full Code Here

            sfw.where = sql;
         }
      }
      public FromReference addFrom(String tableName)
      {
         SQLFrom from = SQLFrom.fromTable(tableName);
         sfw.from.add(from);
         return new SQLSubstitution.FromReference(from);
      }
View Full Code Here

                  SelectFromWhereExtensionJoin.fromSfw(sfw, (EntityManagerBackdoor)emSource),
                  this);
         try {
            if (analysis.paths.size() > 1) return null;
            PathAnalysis path = analysis.paths.get(0);
            SQLQuery subquery = gen.generateFor(path.getSimplifiedReturnValue());
            if (subquery instanceof SQLQuery.SelectFromWhere)
            {
               final SQLQuery.SelectFromWhere<T> subsfw = (SQLQuery.SelectFromWhere<T>)subquery;
               // TODO: Is this sufficient for finding out if a subquery can
               // be safely put into a FROM clause (i.e. the part put into the
View Full Code Here

      {
         if (lambdaContext.joins == null)
            throw new TypedValueVisitorException("Need a join handler here for subqueries just in case there's an embedded navigational query: " + val);
         // TODO: Handle checking out the constructor and verifying how
         // parameters pass through the constructor
         SQLQuery subQuery = val.base.visit(subQueryHandler, in);
         if (sig.equals(TransformationClassAnalyzer.dbsetSumInt)
               || sig.equals(TransformationClassAnalyzer.dbsetMaxInt))
         {
            // TODO: do subqueries need to be copied before being passed in here?
            SQLQuery<Integer> newQuery = null;
View Full Code Here

         }
      }
     
      // TODO: Check that return type and number of columns is the same
      // for all paths
      SQLReader reader = selects[0].reader;
      if (wheres.length > 1)
      {
         for (int n = 0; n < selects[0].columns.length; n++)
         {
            SQLFragment col = new SQLFragment();
View Full Code Here

                     SelectFromWhereExtensionArg.fromReaderColumns(query.reader, sfw.getColumns(), ParamsToJava8LambdaDescription.fromLambda(sorter), -1),
                     paramHandler,
                     null,//SelectFromWhereExtensionJoin.fromSfw(sfw),
                     this);
            List<SQLFragment> columns = new ArrayList<SQLFragment>();
            SQLReader reader = generateSelect(analysis, gen, columns);
            assert(desiredSQLReader.isInstance(reader));
            assert(columns.size() == 1);

            SQLQuery.SortedAndLimited<T> toReturn = null;
            if (!(query instanceof SQLQuery.SortedAndLimited))
View Full Code Here

TOP

Related Classes of ch.epfl.labos.iu.orm.query2.ParameterLocation$LambdaCapturedArg

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.