Example #1
0
  @Override
  public final List<String> getInputSchemata() {
    if (inputSchemata == null) {
      inputSchemata = new ArrayList<String>();

      // [#1312] Allow for ommitting inputSchema configuration. Generate
      // All schemata instead
      if (configuredSchemata.size() == 1
          && StringUtils.isBlank(configuredSchemata.get(0).getInputSchema())) {
        try {
          for (SchemaDefinition schema : getSchemata0()) {
            inputSchemata.add(schema.getName());
          }
        } catch (SQLException e) {
          log.error("Could not load schemata", e);
        }
      } else {
        for (Schema schema : configuredSchemata) {
          /* [pro] xx

          xx xxxxxxx xxxxxx xxx xxxxxxxxxxxxxxxx xxxxxx xxxxxx
          xx xxxxx xxxxxxxxxx xxxxxxxxxxxxxxx x
              xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
          x
          xxxx
          xx [/pro] */
          {
            inputSchemata.add(schema.getInputSchema());
          }
        }
      }
    }

    return inputSchemata;
  }
Example #2
0
  @Override
  public final List<String> getInputSchemata() {
    if (inputSchemata == null) {
      inputSchemata = new ArrayList<String>();

      // [#1312] Allow for ommitting inputSchema configuration. Generate
      // All schemata instead
      if (configuredSchemata.size() == 1
          && StringUtils.isBlank(configuredSchemata.get(0).getInputSchema())) {
        try {
          for (SchemaDefinition schema : getSchemata0()) {
            inputSchemata.add(schema.getName());
          }
        } catch (SQLException e) {
          log.error("Could not load schemata", e);
        }
      } else {
        for (Schema schema : configuredSchemata) {

          // [#1418] Oracle has case-insensitive schema names.
          if (this instanceof OracleDatabase) {
            inputSchemata.add(schema.getInputSchema().toUpperCase());
          } else {
            inputSchemata.add(schema.getInputSchema());
          }
        }
      }
    }

    return inputSchemata;
  }
  /** @see DATASOLR-72 */
  @Test
  public void loadExistingSchemaShouldMapSchemaInformationCorrectly() {

    setUpJsonResponse(JSON_RESPONSE_DEFAULT_SCHEMA);
    SchemaDefinition schemaDef = writer.loadExistingSchema("collection1");

    Assert.assertEquals("example", schemaDef.getName());
    Assert.assertEquals("id", schemaDef.getUniqueKey());
  }
Example #4
0
  @Override
  public final SchemaDefinition getSchema(String inputName) {
    for (SchemaDefinition schema : getSchemata()) {
      if (schema.getName().equals(inputName)) {
        return schema;
      }
    }

    return null;
  }