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

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

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

Row.getPath介绍

[英]Equivalent to Row.getNode().getPath(). However, some implementations may be able gain efficiency by not resolving the actual Node.
[中]相当于Row.getNode().getPath()。然而,有些实现可能会通过不解析实际的Node来提高效率。

代码示例

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

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

代码示例来源:origin: org.apache.jackrabbit/jackrabbit-jcr-commons

public String getPath(String selectorName) throws RepositoryException {
  return row.getPath(selectorName);
}

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

public String getPath(String selectorName) throws RepositoryException {
  return row.getPath(selectorName);
}

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

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

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

public Value getValue(Row row) throws RepositoryException {
    String path;
    if (selectorName != null) {
      path = row.getPath(selectorName);
    } else {
      path = row.getPath();
    }
    return (path == null) ? null : vf.createValue(path, PropertyType.PATH);
  }
}

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

/** {@inheritDoc} */
public String getPath(String selectorName) 
    throws RepositoryException, RemoteException {
  try {
    return row.getPath(selectorName);
  } catch (RepositoryException ex) {
    throw getRepositoryException(ex);    		
  }
}

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

/** {@inheritDoc} */
public String getPath() 
    throws RepositoryException, RemoteException {
  try {
    return row.getPath();
  } catch (RepositoryException ex) {
    throw getRepositoryException(ex);    		
  }
}

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

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

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

public void testGetPathWithSelector() throws RepositoryException {
  Row r = getRow();
  String expectedPath = testRootNode.getNode(nodeName1).getPath();
  assertEquals("unexpected result node", expectedPath, r.getPath(SELECTOR_NAME));
}

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

public void testGetPath() throws RepositoryException {
  Row r = getRow();
  String expectedPath = testRootNode.getNode(nodeName1).getPath();
  assertEquals("unexpected result node", expectedPath, r.getPath());
}

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

@Override
  public void validate( int rowNumber, Row row ) throws RepositoryException {
    expectedResults.remove(row.getPath());
  }
})

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

@Override
  public void validate( int rowNumber, Row row ) throws RepositoryException {
    expectedResults.remove(row.getPath());
  }
})

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

@Override
  public void validate( int rowNumber, Row row ) throws RepositoryException {
    expectedResults2.remove(row.getPath());
  }
})

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

@Override
  public void checkRow( Row row,
             String[] selectorNames ) throws RepositoryException {
    boolean found = false;
    for (int i = 0; i < path.length; i++) {
      if (row.getPath().equals(path[i])) {
        found = true;
        break;
      }
    }
    assertTrue("Path " + row.getPath() + " not found", found);
  }
}

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

@Override
  public void validate( int rowNumber,
             Row row ) throws RepositoryException {
    // Path of all rows should have an even digit at the end ...
    String path = row.getPath();
    int lastIntValue = Integer.parseInt(path.substring(path.length() - 1));
    assertTrue(lastIntValue % 2 == 0);
  }
}).validate(query, result);

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

@Override
  public void validate( int rowNumber, Row row ) throws RepositoryException {
    assertTrue("Path not found", expectedPaths.remove(row.getPath()));
  }
})

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

protected void printRow() throws RepositoryException {
  Row row = iter.nextRow();
  System.out.print(rowNumberStr());
  for (String selectorName : selectorNames) {
    System.out.print(" ");
    System.out.print(row.getPath(selectorName));
  }
  System.out.println();
}

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

@Override
  public void checkRow( Row row,
             String[] selectorNames ) throws RepositoryException {
    Object expected = iterator.next();
    if (expected instanceof String) {
      assertThat(row.getPath(), is((String)expected));
    } else if (expected instanceof Node) {
      assertThat(row.getNode(), is(expected));
    }
  }
}

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

private static String getPaths(Query q) throws RepositoryException {
  QueryResult r = q.execute();
  RowIterator it = r.getRows();
  StringBuilder buff = new StringBuilder();
  if (it.hasNext()) {
    Row row = it.nextRow();
    if (buff.length() > 0) {
      buff.append(", ");
    }
    buff.append(row.getPath());
  }
  return buff.toString();
}

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

private static List<String> queryResult(Session session, String indexedPropName, String value) throws RepositoryException{
    session.refresh(false);
    QueryManager qm = session.getWorkspace().getQueryManager();
    Query q = qm.createQuery("select * from [nt:base] where [" + indexedPropName + "] = $value", Query.JCR_SQL2);
    q.bindValue("value", session.getValueFactory().createValue(value));
    QueryResult result = q.execute();
    List<String> paths = Lists.newArrayList();
    for (Row r : JcrUtils.getRows(result)){
      paths.add(r.getPath());
    }
    return paths;
  }
}

相关文章