Examples of QueryException


Examples of com.mysema.query.QueryException

            } else {
                document = searcher.doc(scoreDocs[cursor++].doc);
            }
            return transformer.apply(document);
        } catch (IOException e) {
            throw new QueryException(e);
        }
    }
View Full Code Here

Examples of com.thinkaurelius.titan.core.QueryException

        private PreSortingIterator(BackendQueryHolder<B> backendQueryHolder) {
            List<R> all = Lists.newArrayList(executor.execute(query,
                    backendQueryHolder.getBackendQuery().updateLimit(MAX_SORT_ITERATION),
                    backendQueryHolder.getExecutionInfo()));
            if (all.size() >= MAX_SORT_ITERATION)
                throw new QueryException("Could not execute query since pre-sorting requires fetching more than " +
                        MAX_SORT_ITERATION + " elements. Consider rewriting the query to exploit sort orders");
            Collections.sort(all, query.getSortOrder());
            iter = all.iterator();
        }
View Full Code Here

Examples of de.iritgo.aktera.query.QueryException

      myConnection = dataSource.getConnection();
      log.debug("[CONNECTION] instantiated: " + myConnection.toString());
    }
    catch (SQLException e)
    {
      throw new QueryException(e, "Obtaining database connection failed");
    }

    //     modified by aleks
    try
    {
      // ===================================================
      // We are building a tabular report which analyzes the objects
      // named in ObjectKeys.  So if ObjectKeys collection is not empty we
      // store ObjectKeys info the id cache table called queryJoin. myQueryId identifies the cache.
      // Warning: If ObjectKeys is empty the method polymorphism
      // getQueryResults with no parameter should be used instead
      // ===================================================
      if (objectKeys != null)
      {
        myQueryId = cacheObjectKeys(objectKeys, myQueryId, myConnection);
      } //end if
      else
      {
        log.warn("\n\n\n getQueryResults(objectKeys) has been called"
                + " with objectKeys == null, but getQueryResults() without parameters should be used");
      }

      // ===================================================
      // now run the query and get tabular report
      // ===================================================
      queryResult = runQuery(myConnection, myQueryId);

      // ===================================================
      // Eliminate the object Keys cache: no longer needed
      // ===================================================
      deCacheObjectKeys(myQueryId, myConnection);
    }
    catch (QueryException qe)
    {
      throw new QueryException(qe);
    }
    finally
    {
      try
      {
        myConnection.close();
        myConnection = null;
      }
      catch (SQLException e1)
      {
        throw new QueryException(e1);
      }
    }

    // modified by aleks
    return queryResult;
View Full Code Here

Examples of org.apache.nutch.searcher.QueryException

        String message = "Wrong query syntax " + FIELD_NAME
          + ":" + dateTerm + ". Must be standalone 14 digit " +
          " IA format date or a range with a hyphen between.";
        LOGGER.error(message);
       
        throw new QueryException(message);
      }

      // So, date is in one of 2 possible formats.  First is standalone
      // 14 character IA date.
      String d = matcher.group(1);
     
      if (d != null)
      {
        LOGGER.debug("Found single date: " + d);

        // This is not a range query. Take the passed date and convert
        // it to seconds-since-epoch.
        BooleanQuery bq = new BooleanQuery();
       
        bq.add(new TermQuery(getTerm(getSeconds(pad(d)))),
          BooleanClause.Occur.SHOULD);
       
        output.add(bq,
          (c.isRequired() == true && c.isProhibited() == false)?
          BooleanClause.Occur.MUST:
          (c.isRequired() == false && c.isProhibited() == false)?
          BooleanClause.Occur.SHOULD:
          BooleanClause.Occur.MUST_NOT);

        continue;
      }

      // OK, must be 2nd possibility: DIGITS-DIGITS.
      String lower = matcher.group(2);
      String upper = matcher.group(3);
     
      if (lower != null && upper != null)
      {
        doRangeQuery(output, c, lower, upper);
     
        continue;
      }

      String message = "Unparseable query " + dateTerm + " (Is " +
        "it in 14 digit IA date format?)";
     
      LOGGER.error(message);
     
      throw new QueryException(message);
    }

    return output;
  }
View Full Code Here

Examples of org.apache.openjpa.util.QueryException

            break;
        case StoreException.REFERENTIAL_INTEGRITY:
            storeEx = new ReferentialIntegrityException(msg);
            break;
        case StoreException.QUERY:
            storeEx = new QueryException(msg);
            break;
        default:
            storeEx = new StoreException(msg);
        }
        storeEx.setFatal(isFatalException(errorType, ex));
View Full Code Here

Examples of org.apache.openjpa.util.QueryException

            break;
        case StoreException.REFERENTIAL_INTEGRITY:
            storeEx = new ReferentialIntegrityException(msg);
            break;
        case StoreException.QUERY:
            storeEx = new QueryException(msg);
            break;
        default:
            storeEx = new StoreException(msg);
        }
        storeEx.setFatal(isFatalException(errorType, ex));
View Full Code Here

Examples of org.apache.pivot.web.QueryException

    @Override
    protected URL doPost(Path path, Object value) throws QueryException {
        if (path.getLength() > 0
            || value == null) {
            throw new QueryException(Query.Status.BAD_REQUEST);
        }

        // Write the value to a temp file
        File directory = new File(System.getProperty("java.io.tmpdir"));
        File file;
        try {
            file = File.createTempFile(getClass().getName(), null, directory);

            JSONSerializer jsonSerializer = new JSONSerializer();
            jsonSerializer.writeObject(value, new FileOutputStream(file));
        } catch (IOException exception) {
            throw new QueryException(Query.Status.INTERNAL_SERVER_ERROR);
        } catch (SerializationException exception) {
            throw new QueryException(Query.Status.INTERNAL_SERVER_ERROR);
        }

        // Return the location of the resource
        URL location;
        try {
            location = new URL(getLocation(), file.getName());
        } catch (MalformedURLException exception) {
            throw new QueryException(Query.Status.INTERNAL_SERVER_ERROR);
        }

        return location;
    }
View Full Code Here

Examples of org.atomojo.app.db.sparql.QueryException

                           dest.send(constructor.createCharacters("\n"));
                           text(constructor,dest,AtomResource.ID_NAME,UUID.randomUUID().toString());
                           dest.send(constructor.createCharacters("\n"));
                           text(constructor,dest,AtomResource.UPDATED_NAME,AtomResource.toXSDDate(new Date()));
                        } catch (XMLException ex) {
                           throw new QueryException("Exception during feed start.",ex);
                        }
                     }

                     public void onEnd() throws QueryException {
                        try {
                           dest.send(constructor.createCharacters("\n"));
                           dest.send(constructor.createElementEnd(AtomResource.FEED_NAME));
                           dest.send(constructor.createDocumentEnd());
                        } catch (XMLException ex) {
                           throw new QueryException("Exception during feed end.",ex);
                        }
                     }

                     public void onEntry(Entry entry) throws QueryException {
                        try {
                           Feed feed = entry.getFeed();
                           String feedPath = feed.getPath();
                           String feedBaseURI = resourceBase.toString()+feedPath;
                           dest.send(constructor.createCharacters("\n"));

                           // get the entry representation
                           Representation rep = app.getStorage().getEntry(feedBaseURI,feedPath,feed.getUUID(),entry.getUUID());

                           // avoid thread creation because reading an output representation requires a thread
                           StringWriter sw = new StringWriter();
                           rep.write(sw);
                           rep.release();

                           // TODO: optimize by giving item destination to storage
                           loader.generate(new StringReader(sw.toString()), new RemoveDocumentFilter(dest));
                        } catch (Exception ex) {
                           throw new QueryException("Exception during feed entry generation.",ex);
                        }
                     }

                     public void onFeed(Feed feed) throws QueryException {
                        try {
                           org.atomojo.app.client.Feed feedRep = new org.atomojo.app.client.Feed(xmlParser.load(app.getStorage().getFeedHead(feed.getPath(), feed.getUUID())));
                           dest.send(constructor.createCharacters("\n"));
                           dest.send(constructor.createElement(AtomResource.ENTRY_NAME));
                           text(constructor,dest,AtomResource.ID_NAME,feed.getUUID().toString());
                           text(constructor,dest,AtomResource.PUBLISHED_NAME,AtomResource.toXSDDate(feed.getCreated()));
                           text(constructor,dest,AtomResource.UPDATED_NAME,AtomResource.toXSDDate(feed.getEdited()));
                           text(constructor,dest,AtomResource.TITLE_NAME,feedRep.getTitle());
                           String summary = feedRep.getSummary();
                           text(constructor,dest,AtomResource.SUMMARY_NAME,summary);
                           term(constructor,dest,Categorization.FEED_TYPE_TERM,null);
                           Iterator<TermInstance<Feed>> terms = feed.getTerms();
                           while (terms.hasNext()) {
                              TermInstance<Feed> fterm = terms.next();
                              term(constructor,dest,fterm.getTerm().getURI(),fterm.getValue());
                           }
                           link(constructor,dest,"related",resourceBase+feed.getPath());
                           dest.send(constructor.createElementEnd(AtomResource.ENTRY_NAME));
                        } catch (Exception ex) {
                           throw new QueryException("Exception during feed entry generation.",ex);
                        }
                     }
                  } );
               } catch (QueryException ex) {
                  getContext().getLogger().log(Level.SEVERE,"Cannot execute query",ex);
View Full Code Here

Examples of org.cyclop.model.exception.QueryException

    } catch (DriverException e) {
      LOG.debug(e.getMessage());
      LOG.trace(e.getMessage(), e);

      status.error.getAndIncrement();
      resultWriter.error(query, new QueryException(e.getMessage(), e), System.currentTimeMillis() - startTime);
    } catch (Exception e) {
      LOG.info("Unknown error while executing parallel import for: " + query + ", Msg:" + e.getMessage());
      LOG.trace(e.getMessage(), e);

      resultWriter.unknownError(query, e, System.currentTimeMillis() - startTime);
View Full Code Here

Examples of org.exolab.castor.jdo.QueryException

                throw new DTXException("Missing WHERE clause");
            }
            addField(_clsMapping, token, expr);
            while (token.hasMoreTokens()) {
                if (!token.nextToken().equals("AND")) {
                throw new QueryException("Only AND supported in WHERE clause");
                }
                addField(_clsMapping, token, expr);
            }
            }
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.