javax.jcr.version.Version.getReferences()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(126)

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

Version.getReferences介绍

暂无

代码示例

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

public void testVersionReferencesV1() throws RepositoryException {
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  n.addMixin(mixVersionable);
  superuser.save();
  String p = n.getPath();
  VersionManager vMgr = superuser.getWorkspace().getVersionManager();
  Version v1 = vMgr.checkpoint(p);
  // check if versionable node has references to v1.0
  assertEquals("v1.0", v1.getIdentifier(), n.getProperty(Property.JCR_BASE_VERSION).getString());
  assertEquals("v1.0", v1.getIdentifier(), n.getProperty(Property.JCR_PREDECESSORS).getValues()[0].getString());
  checkReferences("v1.0", v1.getReferences(),
      p + "/jcr:baseVersion",
      p + "/jcr:predecessors"
  );
}

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

public void testVersionReferencesV0() throws RepositoryException {
  Node n = testRootNode.addNode(nodeName1, testNodeType);
  n.addMixin(mixVersionable);
  superuser.save();
  String p = n.getPath();
  VersionManager vMgr = superuser.getWorkspace().getVersionManager();
  Version v0 = vMgr.getVersionHistory(p).getRootVersion();
  // check if versionable node has references to root version
  assertEquals("Root Version", v0.getIdentifier(), n.getProperty(Property.JCR_BASE_VERSION).getString());
  assertEquals("Root Version", v0.getIdentifier(), n.getProperty(Property.JCR_PREDECESSORS).getValues()[0].getString());
  checkReferences("Root Version", v0.getReferences(),
      p + "/jcr:baseVersion",
      p + "/jcr:predecessors"
  );
}

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

if (!excludeReferenced || !v.getReferences().hasNext()) {
  allVersions.add(v);

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

} else if (CHECKOUT_SET.equals(name)) {
  PropertyIterator it = v.getReferences();
  List<Node> nodeList = new ArrayList<Node>();
  while (it.hasNext()) {

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

PropertyIterator it = v.getReferences();
List<Node> nodeList = new ArrayList<Node>();
while (it.hasNext()) {

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

public void testCheckinRemoveVersionWithXA() throws Exception {
    Node n = testRootNode.addNode(nodeName1);
    n.addMixin(mixVersionable);
    testRootNode.save();
    UserTransactionImpl tx = new UserTransactionImpl(superuser);
    tx.begin();
    try {
      Version v10 = n.checkin();
      assertTrue("Version.getReferences() must return base version", v10.getReferences().hasNext());
      try {
        n.getVersionHistory().removeVersion(v10.getName());
        fail("VersionHistory.removeVersion() must throw ReferentialIntegrityException when" +
            " version is still referenced.");
      } catch (ReferentialIntegrityException e) {
        // expected
      }
    } finally {
      tx.rollback();
    }
  }
}

相关文章