Package org.apache.metamodel

Examples of org.apache.metamodel.MetaModelException


        close();
        if (_resource instanceof FileResource) {
            final File file = ((FileResource) _resource).getFile();
            final boolean success = file.delete();
            if (!success) {
                throw new MetaModelException("Could not delete (drop) file: " + file);
            }
        } else {
            _resource.write(new Action<OutputStream>() {
                @Override
                public void run(OutputStream arg) throws Exception {
View Full Code Here


      try {
        if (connection != null) {
          connection.createStatement().execute("DROP TABLE my_table");
        }
      } catch (SQLException e) {
        throw new MetaModelException(
            "Failed to execute INSERT statement", e);
      }
    }

  }
View Full Code Here

          errornousResultsDescriptions.add(error);
        }
      }

      if (!errornousResultsDescriptions.isEmpty()) {
        throw new MetaModelException(errornousResultsDescriptions.size() + " out of " + results.size()
            + " operations in bulk was errornous: " + errornousResultsDescriptions);
      }
    }
  }
View Full Code Here

            logger.debug("Created JSON parser for resource: {}", _resource);

            return new JsonDocumentSource(parser, _resource.getName());
        } catch (Exception e) {
            FileHelper.safeClose(inputStream);
            throw new MetaModelException("Unexpected error while creating JSON parser", e);
        }
    }
View Full Code Here

    }
    if (_error != null) {
      if (_error instanceof RuntimeException) {
        throw (RuntimeException) _error;
      }
      throw new MetaModelException(_error);
    }
    // "busy" (1 second) wait
    return next();
  }
View Full Code Here

    @SuppressWarnings("unchecked")
    private Map<String, ?> readValue() {
        try {
            return _parser.readValueAs(Map.class);
        } catch (Exception e) {
            throw new MetaModelException(e);
        }
    }
View Full Code Here

    private JsonToken getNextToken() {
        try {
            return _parser.nextToken();
        } catch (Exception e) {
            throw new MetaModelException(e);
        }
    }
View Full Code Here

            final List<SelectItem> items = fromItem.getSubQuery().getSelectClause().getItems();
            for (final SelectItem subQuerySelectItem : items) {
                select(new SelectItem(subQuerySelectItem, fromItem));
            }
        } else {
            throw new MetaModelException("All select items ('*') not determinable with from item: " + fromItem);
        }
        return this;
    }
View Full Code Here

            final CSVParser parser = _dataSet.getCsvParser();
            final String[] csvValues;
            try {
                csvValues = parser.parseLine(_line);
            } catch (IOException e) {
                throw new MetaModelException("Failed to parse CSV line no. " + _rowNumber + ": " + _line);
            }

            if (_failOnInconsistentRowLength) {
                if (_columnsInTable != csvValues.length) {
                    throw new InconsistentRowLengthException(_columnsInTable, SingleLineCsvRow.this, csvValues,
View Full Code Here

                dbf.setIgnoringComments(true);
                DocumentBuilder db = dbf.newDocumentBuilder();
                Document document = db.parse(inputSource);
                loadSchema(document);
            } catch (Exception e) {
                throw new MetaModelException("Error parsing XML file: " + e.getMessage(), e);
            }
        }
        return this;
    }
View Full Code Here

TOP

Related Classes of org.apache.metamodel.MetaModelException

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.