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

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

本文整理了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

  1. /** {@inheritDoc} */
  2. public String getStoredQueryPath()
  3. throws RepositoryException, RemoteException {
  4. return query.getStoredQueryPath();
  5. }

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

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

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

  1. /**
  2. * @inheritDoc
  3. */
  4. public String getStoredQueryPath() throws ItemNotFoundException, RepositoryException {
  5. return query.getStoredQueryPath();
  6. }

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

  1. @Override
  2. public String getStoredQueryPath() throws RepositoryException {
  3. return delegate.getStoredQueryPath();
  4. }

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

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

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

  1. public String execute() throws Exception {
  2. return getDelegate().getStoredQueryPath();
  3. }
  4. });

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

  1. /**
  2. * Tests if a non-persistent query throws an {@link ItemNotFoundException}
  3. * when {@link Query#getStoredQueryPath()} is called.
  4. */
  5. public void testGetStoredQueryPath() throws RepositoryException {
  6. String statement = "/" + jcrRoot;
  7. Query q = session.getWorkspace().getQueryManager().createQuery(statement, qsXPATH);
  8. try {
  9. q.getStoredQueryPath();
  10. fail("Query.getStoredQueryPath() on a transient query must throw an ItemNotFoundException.");
  11. } catch (ItemNotFoundException e) {
  12. // success
  13. }
  14. }
  15. }

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

  1. /**
  2. * Tests if {@link Query#getStoredQueryPath()} returns the correct path
  3. * where the query had been saved.
  4. *
  5. * @throws NotExecutableException if the repository does not support the
  6. * node type nt:query.
  7. */
  8. public void testGetPersistentQueryPath() throws RepositoryException, NotExecutableException {
  9. try {
  10. superuser.getWorkspace().getNodeTypeManager().getNodeType(ntQuery);
  11. } catch (NoSuchNodeTypeException e) {
  12. // not supported
  13. throw new NotExecutableException("repository does not support nt:query");
  14. }
  15. String statement = "/" + jcrRoot;
  16. Query q = superuser.getWorkspace().getQueryManager().createQuery(statement, qsXPATH);
  17. String path = testRoot + "/" + nodeName1;
  18. q.storeAsNode(path);
  19. assertEquals("Query.getPersistentQueryPath() does not return the correct path.",
  20. path,
  21. q.getStoredQueryPath());
  22. }
  23. }

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

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

相关文章