Package org.eobjects.analyzer.connection

Examples of org.eobjects.analyzer.connection.DataContextProvider


          + tables.length);
    }

    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


        FileHelper.DEFAULT_ENCODING);
  }

  @Override
  public Table getPreviewTable(Datastore datastore) {
    DataContextProvider dcp = datastore.getDataContextProvider();
    Table table = dcp.getDataContext().getDefaultSchema().getTables()[0];
    dcp.close();
    return table;
  }
View Full Code Here

    return datastoreCatalog.getDatastore(_datastoreName);
  }

  @Override
  public Table getPreviewTable(Datastore datastore) {
    DataContextProvider dcp = datastore.getDataContextProvider();
    DataContext dc = dcp.getDataContext();

    // It is likely that schemas are cached, and since it is likely a new
    // table, we refresh the schema.
    dc.refreshSchemas();

    Table table = dc.getDefaultSchema().getTableByName(_tableName);
    dcp.close();
    return table;
  }
View Full Code Here

    return new ExcelDatastore(_file.getName(), _file.getPath());
  }

  @Override
  public Table getPreviewTable(Datastore datastore) {
    DataContextProvider dcp = datastore.getDataContextProvider();
    Table table = dcp.getDataContext().getDefaultSchema().getTableByName(_sheetName);
    dcp.close();
    return table;
  }
View Full Code Here

      throw _exception;
    }
    assertEquals(9, datastoreCount.get());

    assertNotNull(_datastore);
    DataContextProvider dataContextProvider = _datastore.getDataContextProvider();
    DataContext dc = dataContextProvider.getDataContext();
    dc.refreshSchemas();
    String[] tableNames = dc.getDefaultSchema().getTableNames();
    Arrays.sort(tableNames);

    assertEquals("[TAB_1, TAB_2, TAB_3, TAB_4, TAB_5, TAB_6, TAB_7, TAB_8, TAB_9]", Arrays.toString(tableNames));
View Full Code Here

      @Override
      public void createDatastore(Datastore datastore) {
        _datastoreCreated = true;
        assertEquals("my datastore", datastore.getName());

        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();
      }
    };
    OutputWriter writer = DatastoreOutputWriterFactory.getWriter(outputDir, creationDelegate, "my datastore", "dataset",
        scenarioHelper.getColumns().toArray(new InputColumn[0]));
View Full Code Here

    // run a small job
    AnalyzerBeansConfiguration conf = new JaxbConfigurationReader().create(new File(DataCleanerHome.get(), "conf.xml"));
    final AnalysisJobBuilder ajb = new AnalysisJobBuilder(conf);
    Datastore ds = conf.getDatastoreCatalog().getDatastore("orderdb");
    DataContextProvider dcp = ds.getDataContextProvider();
    SchemaNavigator sn = dcp.getSchemaNavigator();
    ajb.setDatastore(ds);
    ajb.addSourceColumns(sn.convertToTable("PUBLIC.TRIAL_BALANCE").getColumns());
    ajb.addRowProcessingAnalyzer(ValueDistributionAnalyzer.class).addInputColumns(ajb.getSourceColumns());

    ajb.addSourceColumns(sn.convertToTable("PUBLIC.CUSTOMERS").getColumns());
View Full Code Here

    // run a small job
    final AnalyzerBeansConfiguration conf = new JaxbConfigurationReader().create(new File(DataCleanerHome.get(),
        "conf.xml"));
    final AnalysisJobBuilder ajb = new AnalysisJobBuilder(conf);
    Datastore ds = conf.getDatastoreCatalog().getDatastore("orderdb");
    DataContextProvider dcp = ds.getDataContextProvider();
    Table table = dcp.getSchemaNavigator().convertToTable("PUBLIC.CUSTOMERS");
    ajb.setDatastore(ds);
    ajb.addSourceColumns(table.getLiteralColumns());
    ajb.addRowProcessingAnalyzer(PatternFinderAnalyzer.class).addInputColumns(ajb.getSourceColumns())
        .setName("Ungrouped pattern finders");
View Full Code Here

    AnalysisJobBuilder ajb = new AnalysisJobBuilder(conf);

    Datastore ds = conf.getDatastoreCatalog().getDatastore("orderdb");
    ajb.setDatastore(ds);

    DataContextProvider dcp = ds.getDataContextProvider();
    Table table = dcp.getSchemaNavigator().convertToTable("PUBLIC.ORDERS");

    ajb.addSourceColumn(table.getColumnByName("ORDERDATE"));
    ajb.addSourceColumn(table.getColumnByName("SHIPPEDDATE"));
    ajb.addSourceColumn(table.getColumnByName("CUSTOMERNUMBER"));
View Full Code Here

    if (datastore == null) {
      setDataContextProvider(null);
      setModel(new DefaultComboBoxModel(new String[1]));
    } else {

      DataContextProvider dcp = setDataContextProvider(datastore.getDataContextProvider());

      int selectedIndex = 0;

      List<Object> comboBoxList = new ArrayList<Object>();
      comboBoxList.add(null);

      Schema[] schemas = dcp.getSchemaNavigator().getSchemas();
      Arrays.sort(schemas, new SchemaComparator());

      for (Schema schema : schemas) {
        comboBoxList.add(schema);
        if (!SchemaComparator.isInformationSchema(schema)) {
View Full Code Here

TOP

Related Classes of org.eobjects.analyzer.connection.DataContextProvider

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.