Package org.eobjects.metamodel

Examples of org.eobjects.metamodel.DataContext.query()


    final Table table = tables[0];

    final DataContextProvider dataContextProvider = _analysisJobBuilder.getDataContextProvider();
    final DataContext dc = dataContextProvider.getDataContext();
    final Query q = dc.query().from(table).select(physicalColumns.toArray(new Column[physicalColumns.size()])).toQuery();
    q.setMaxRows(DEFAULT_PREVIEW_ROWS);

    for (TransformerJobBuilder<?> tjb : transformerJobs) {
      initialize(tjb);
    }
View Full Code Here


        }
      }
      columns = cols.toArray(new Column[cols.size()]);
    }
    DataContext dc = _dataContextProvider.getDataContext();
    Query q = dc.query().from(columns[0].getTable()).select(columns).toQuery();

    DataSetWindow window = new DataSetWindow(q, dc, PAGE_SIZE, _windowContext);
    window.setVisible(true);
  }
}
View Full Code Here

    scenarioHelper.writeExampleData(writer);
    writer.close();
   
    DataContext dc = DataContextFactory.createCsvDataContext(new File(filename));
    Table table = dc.getDefaultSchema().getTables()[0];
    Query q = dc.query().from(table).select(table.getColumns()).toQuery();
    DataSet dataSet = dc.executeQuery(q);
   
    scenarioHelper.performAssertions(dataSet, false);
  }
}
View Full Code Here

        DataContextProvider dcp = datastore.getDataContextProvider();
        DataContext dc = dcp.getDataContext();

        Table table = dc.getDefaultSchema().getTables()[0];
        Query q = dc.query().from(table).select(table.getColumns()).toQuery();
        DataSet dataSet = dc.executeQuery(q);

        scenarioHelper.performAssertions(dataSet, true);

        dcp.close();
View Full Code Here

      DataContext dc = DataContextFactory.createCsvDataContext(url.openStream(), ',', '"', false);
      Table table = dc.getDefaultSchema().getTables()[0];
      Column projectColumn = table.getColumnByName("Project");
      Column websiteColumn = table.getColumnByName("Website");
      Column licenseColumn = table.getColumnByName("License");
      Query q = dc.query().from(table).select(table.getColumns()).orderBy(projectColumn).asc().toQuery();
      DataSet ds = dc.executeQuery(q);
      while (ds.next()) {
        final LicensedProject licensedProject = new LicensedProject();
        final Row row = ds.getRow();
        final String licenseName = row.getValue(licenseColumn).toString();
View Full Code Here

    Column[] columns = table.getColumns();
    if (columns.length > getPreviewColumns()) {
      // include max 10 columns
      columns = Arrays.copyOf(columns, getPreviewColumns());
    }
    Query q = dc.query().from(table).select(columns).toQuery();
    q.setMaxRows(7);

    DataSet dataSet = dc.executeQuery(q);

    dcp.close();
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.