Examples of QueryExpression


Examples of org.jpox.store.mapped.expression.QueryExpression

    public QueryExpression getExistsSubquery(QueryExpression qs,
                                            JavaTypeMapping mapping,
                                            LogicSetExpression ownerTe,
                                            DatastoreIdentifier mapTableAlias)
    {
        QueryExpression stmt = dba.newQueryStatement(mapTable, mapTableAlias, qs.getClassLoaderResolver());
        stmt.setParent(qs);

        // Join to the owner
        ScalarExpression ownerExpr = mapping.newScalarExpression(stmt, ownerTe);
        ScalarExpression ownerInMapExpr = ownerMapping.newScalarExpression(stmt, stmt.getTableExpression(mapTableAlias));
        stmt.andCondition(ownerExpr.eq(ownerInMapExpr));

        stmt.select(mapTableAlias, valueMapping);

        return stmt;
    }
View Full Code Here

Examples of org.sql.generation.api.grammar.query.QueryExpression

            t.tableBuilder( t.table( q.createQuery( innerBuilder.createExpression() ),
                                     t.tableAlias( TABLE_NAME_PREFIX + "0" ) ) ) );

        this.processOrderBySegments( orderBySegments, vendor, mainQuery );

        QueryExpression finalMainQuery = this.finalizeQuery(
            vendor, mainQuery, resultType, whereClause,
            orderBySegments, firstResult, maxResults, variables, values, valueSQLTypes,
            countOnly );

        String result = vendor.toString( finalMainQuery );
View Full Code Here

Examples of org.teiid.language.QueryExpression

        }
             
        this.rowsNeeded = this.config.getRowCount();
       
        if (command instanceof QueryExpression) {
            QueryExpression queryCommand = (QueryExpression)command;
            if (queryCommand.getLimit() != null) {
              this.rowsNeeded = queryCommand.getLimit().getRowLimit();
            }
        }
       
        // Prepare for execution
        List types = determineOutputTypes(this.command);
View Full Code Here

Examples of org.teiid.language.QueryExpression

    }

    private List determineOutputTypes(Command command) {           
        // Get select columns and lookup the types in metadata
        if(command instanceof QueryExpression) {
            QueryExpression query = (QueryExpression) command;
            return Arrays.asList(query.getColumnTypes());
        }
        if (command instanceof Call) {
          return Arrays.asList(((Call)command).getResultSetColumnTypes());
        }
        List<Class<?>> types = new ArrayList<Class<?>>(1);
View Full Code Here

Examples of org.teiid.language.QueryExpression

      }
     
      if (!(command instanceof QueryExpression)) {
        return null;
      }
    QueryExpression queryCommand = (QueryExpression)command;
    if (queryCommand.getLimit() == null) {
      return null;
      }
    Limit limit = queryCommand.getLimit();
    queryCommand.setLimit(null);
      List<Object> parts = new ArrayList<Object>();
      parts.add("SELECT "); //$NON-NLS-1$
      /*
       * if all of the columns are aliased, assume that names matter - it actually only seems to matter for
       * the first query of a set op when there is a order by.  Rather than adding logic to traverse up,
       * we just use the projected names
       */
      boolean allAliased = true;
      for (DerivedColumn selectSymbol : queryCommand.getProjectedQuery().getDerivedColumns()) {
      if (selectSymbol.getAlias() == null) {
        allAliased = false;
        break;
      }
    }
      if (allAliased) {
        String[] columnNames = queryCommand.getColumnNames();
        for (int i = 0; i < columnNames.length; i++) {
          if (i > 0) {
            parts.add(", "); //$NON-NLS-1$
          }
          parts.add(columnNames[i]);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.