javax.jcr.query.Query.getStoredQueryPath()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(3.3k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中javax.jcr.query.Query.getStoredQueryPath方法的一些代码示例,展示了Query.getStoredQueryPath的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.getStoredQueryPath方法的具体详情如下:
包路径:javax.jcr.query.Query
类名称:Query
方法名:getStoredQueryPath

Query.getStoredQueryPath介绍

[英]If this is a Query object that has been stored using Query#storeAsNode (regardless of whether it has been saved yet) or retrieved using QueryManager#getQuery), then this method returns the path of the nt:query node that stores the query.
[中]如果这是一个使用Query#storeAsNode存储的Query对象(不管它是saved还是使用QueryManager#getQuery检索的),则此方法返回存储查询的nt:query节点的路径。

代码示例

代码示例来源:origin: apache/jackrabbit

/** {@inheritDoc} */
public String getStoredQueryPath()
    throws RepositoryException, RemoteException {
  return query.getStoredQueryPath();
}

代码示例来源:origin: info.magnolia/magnolia-core

@Override
public String getStoredQueryPath() throws ItemNotFoundException, RepositoryException {
  return this.query.getStoredQueryPath();
}

代码示例来源:origin: org.onehippo.cms7/hippo-repository-connector

/**
 * @inheritDoc
 */
public String getStoredQueryPath() throws ItemNotFoundException, RepositoryException {
  return query.getStoredQueryPath();
}

代码示例来源:origin: net.adamcin.oakpal/oakpal-core

@Override
public String getStoredQueryPath() throws RepositoryException {
  return delegate.getStoredQueryPath();
}

代码示例来源:origin: brix-cms/brix-cms

public String getStoredQueryPath() throws RepositoryException {
  return getDelegate().getStoredQueryPath();
}

代码示例来源:origin: brix-cms/brix-cms

public String execute() throws Exception {
    return getDelegate().getStoredQueryPath();
  }
});

代码示例来源:origin: apache/jackrabbit

/**
   * Tests if a non-persistent query throws an {@link ItemNotFoundException}
   * when {@link Query#getStoredQueryPath()} is called.
   */
  public void testGetStoredQueryPath() throws RepositoryException {
    String statement = "/" + jcrRoot;
    Query q = session.getWorkspace().getQueryManager().createQuery(statement, qsXPATH);
    try {
      q.getStoredQueryPath();
      fail("Query.getStoredQueryPath() on a transient query must throw an ItemNotFoundException.");
    } catch (ItemNotFoundException e) {
      // success
    }
  }
}

代码示例来源:origin: apache/jackrabbit

/**
   * Tests if {@link Query#getStoredQueryPath()} returns the correct path
   * where the query had been saved.
   *
   * @throws NotExecutableException if the repository does not support the
   *                                node type nt:query.
   */
  public void testGetPersistentQueryPath() throws RepositoryException, NotExecutableException {
    try {
      superuser.getWorkspace().getNodeTypeManager().getNodeType(ntQuery);
    } catch (NoSuchNodeTypeException e) {
      // not supported
      throw new NotExecutableException("repository does not support nt:query");
    }
    String statement = "/" + jcrRoot;
    Query q = superuser.getWorkspace().getQueryManager().createQuery(statement, qsXPATH);
    String path = testRoot + "/" + nodeName1;
    q.storeAsNode(path);
    assertEquals("Query.getPersistentQueryPath() does not return the correct path.",
        path,
        q.getStoredQueryPath());
  }
}

代码示例来源:origin: ModeShape/modeshape

@Test
public void shouldLoadStoredQuery() throws Exception {
  String statement = "SELECT * FROM [nt:unstructured]";
  QueryManager queryManager = workspace.getQueryManager();
  Query query = queryManager.createQuery(statement, Query.JCR_SQL2);
  Node node = query.storeAsNode("/storedQuery");
  Query loaded = queryManager.getQuery(node);
  assertThat(loaded, is(notNullValue()));
  assertThat(loaded.getLanguage(), is(Query.JCR_SQL2));
  assertThat(loaded.getStatement(), is(statement));
  assertThat(loaded.getStoredQueryPath(), is(node.getPath()));
}

相关文章