Examples of Query


Examples of org.objectweb.speedo.jmx.mbeans.Query

        CacheManager cm = (CacheManager) cache.getFcInterface("cache-manager");
        QueryManagerAttribute qma = (QueryManagerAttribute)
          Fractal.getAttributeController(
                FractalHelper.getSubComponent(
                        speedo, AbstractSpeedo.QUERY_MANAGER, logger));
        Query qm = new Query(ca, um, cm, qma);
        server.registerMBean(qm, new ObjectName("speedo:name=query"));
    }
View Full Code Here

Examples of org.ocpsoft.rewrite.servlet.config.Query

      Set<String> parameters = getPathRequestParameters();
      if (outboundConditionCache == null)
      {
         this.outboundConditionCache = resourcePath;
         for (String name : parameters) {
            Query parameter = Query.parameterExists(name);
            outboundConditionCache = outboundConditionCache.and(parameter);
         }
      }

      return this;
View Full Code Here

Examples of org.odbms.Query

   */
  public void testDdiscLast3YearsTitleStartWithJohn()
  {
    final AtomicInteger cnt = new AtomicInteger();

    Query query = db.query(new Predicate<Disc>() {
      public boolean match(Disc disc)
      {
        if (disc.getAge() <= 3 && disc.getAge() != -1) {
          cnt.incrementAndGet();
          return true;
        } else {
          return false;
        }
      }
    });
    query.constrain("DTITLE", OP.STARTS_WITH, "John");

    ObjectSet<Disc> discs = query.execute();
    for (Disc disc : discs) {
      if (disc.getAge() > 3)
        fail("Disc age >3");
      if (!disc.getDTITLE().startsWith("John"))
        fail("DTITLE does not start with 'John'");
View Full Code Here

Examples of org.openrdf.query.Query

  @Override
  protected void runTest()
    throws Exception
  {
    String queryString = readQueryString();
    Query query = prepareQuery(queryString);

    if (query instanceof TupleQuery) {
      TupleResult queryResult = ((TupleQuery)query).evaluate();

      TupleResult expectedResult = readExpectedTupleQueryResult();
      compareTupleQueryResults(queryResult, expectedResult);

      // Graph queryGraph = RepositoryUtil.asGraph(queryResult);
      // Graph expectedGraph = readExpectedTupleQueryResult();
      // compareGraphs(queryGraph, expectedGraph);
    }
    else if (query instanceof GraphQuery) {
      GraphResult gqr = ((GraphQuery)query).evaluate();
      Set<Statement> queryResult = gqr.asSet();

      Set<Statement> expectedResult = readExpectedGraphQueryResult();

      compareGraphs(queryResult, expectedResult);
    }
    else if (query instanceof BooleanQuery) {
      boolean queryResult = ((BooleanQuery)query).ask();
      boolean expectedResult = readExpectedBooleanQueryResult();
      assertEquals(expectedResult, queryResult);
    }
    else {
      throw new RuntimeException("Unexpected query type: " + query.getClass());
    }
  }
View Full Code Here

Examples of org.opensolaris.opengrok.egrok.query.Query

          Point topLeft = new Point(bounds.x, bounds.y + bounds.height);
          topLeft = searchBox.getShell().toDisplay(topLeft);

          final ResultsDialog dialog = new ResultsDialog(Display.getCurrent().getActiveShell(), text, topLeft);

          Query query = new Query(text);
          disableFocusLostEvent = true;
          query.run(dialog);
          disableFocusLostEvent = false;
        }
      }
    });
View Full Code Here

Examples of org.pentaho.metadata.query.model.Query

   */
  public TableModel queryData(final String queryName, final DataRow parameters) throws ReportDataFactoryException
  {
    // domain must exist and be loaded in the domain repository already
    // parse the metadata query
    final Query queryObject = parseQuery(queryName);

    try
    {
      final DatabaseMeta databaseMeta = getDatabaseMeta(queryObject);
      final DatabaseMeta activeDatabaseMeta = getActiveDatabaseMeta(databaseMeta, parameters);
View Full Code Here

Examples of org.pentaho.reporting.engine.classic.core.designtime.datafactory.editor.model.Query

                                                final boolean isSelected,
                                                final boolean cellHasFocus)
  {
    if (value instanceof Query)
    {
      Query q = (Query) value;
      return super.getListCellRendererComponent(list, q.getName(), index, isSelected, cellHasFocus);
    }

    return super.getListCellRendererComponent(list, null, index, isSelected, cellHasFocus);
  }
View Full Code Here

Examples of org.qi4j.api.query.Query

        EntityDetailDescriptor entityDescriptor = (EntityDetailDescriptor) entitiesCombo.getSelectedItem();
        Class clazz = first( entityDescriptor.descriptor().types() );

        Module module = findModule( entityDescriptor );
        Query query = createQuery( module, clazz );
        propertiesPanel.reload( query );
    }
View Full Code Here

Examples of org.restsql.core.sqlresource.Query

   */
  protected int createDefs(final File subDirObj, final String databaseName, final String exclusionPattern) throws GenerationException {
    // Create definition object
    final ObjectFactory objectFactory = new ObjectFactory();
    final SqlResourceDefinition def = objectFactory.createSqlResourceDefinition();
    final Query query = objectFactory.createQuery();
    def.setQuery(query);
    final MetaData metaData = objectFactory.createMetaData();
    final Database database = objectFactory.createDatabase();
    database.setDefault(databaseName);
    metaData.setDatabase(database);
    final Table table = objectFactory.createTable();
    table.setRole("Parent");
    metaData.getTable().add(table);
    def.setMetadata(metaData);

    StringBuilder queryString = null;
    int defsCreated = 0;

    // Now inspect the information schema for columns and tables, build definition and write the files
    Connection connection = null;
    try {
      connection = Factory.getConnection(databaseName);
 
      // Build SQL query, prepare statement and execute
      String sql = getColumnsQuery();
      if (exclusionPattern != null) {
        sql += getTableExclusionQueryClause();
      }
      final PreparedStatement statement = connection.prepareStatement(sql);
      statement.setString(1, databaseName);
      if (exclusionPattern != null) {
        statement.setString(2, exclusionPattern);
      }
      Config.logger.info(sql);
      final ResultSet resultSet = statement.executeQuery();
     
      // Iterate through results, create build def and write the files
      while (resultSet.next()) {
        final String columnName = resultSet.getString(1);
        final String tableName = resultSet.getString(2);

        if (!tableName.equals(table.getName())) {
          if (defsCreated > 0) {
            // Complete previous def and write it
            queryString.append("\n\t\tFROM ");
            queryString.append(table.getName());
            queryString.append("\n\t");
            query.setValue(queryString.toString());
            writeDef(subDirObj, def, table.getName());
            table.setName(tableName);
          } else {
            table.setName(tableName);
          }

          // Start new def
          defsCreated++;
          queryString = new StringBuilder();
          queryString.append("\n\t\tSELECT ");
          queryString.append(columnName);
        } else {
          queryString.append(", ");
          queryString.append(columnName);
        }
      }
      // Finish up the last one
      if (defsCreated > 0) {
        queryString.append(" FROM ");
        queryString.append(table.getName());
        query.setValue(queryString.toString());
        writeDef(subDirObj, def, table.getName());
      }
    } catch (final SQLException exception) {
      throw new GenerationException(exception.toString());
    } finally {
View Full Code Here

Examples of org.saiku.query.Query

  @Nullable
  @Deprecated
  public ThinQuery createEmpty(String name, SaikuCube cube) {
    try {
      Cube cub = olapDiscoverService.getNativeCube(cube);
      Query query = new Query(name, cub);
      ThinQuery tq = Thin.convert(query, cube);
      return tq;

    } catch (Exception e) {
      LOG.error("Cannot create new query for cube :" + cube, e);
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.