Пример #1
0
  public QueryResult execute() throws RepositoryException {
    QueryProvider qp = m_session.getWorkspace().getQueryManager().getQueryProvider();

    System.out.println("Executing " + getStatement());

    return qp.query(m_session, m_root);
  }
Пример #2
0
  public Node storeAsNode(String absPath)
      throws ItemExistsException, PathNotFoundException, VersionException,
          ConstraintViolationException, LockException, UnsupportedRepositoryOperationException,
          RepositoryException {
    Node queryNode = m_session.getRootNode().addNode(absPath, "nt:query");

    queryNode.setProperty("jcr:statement", getStatement());
    queryNode.setProperty("jcr:language", getLanguage());

    m_storedQueryPath = queryNode.getPath();

    return queryNode;
  }