org.apache.isis.core.metamodel.adapter.oid.Oid.getPrevious()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(1.8k)|赞(0)|评价(0)|浏览(97)

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

Oid.getPrevious介绍

[英]Returns the pending oid if there is one.
[中]返回挂起的oid(如果有)。

代码示例

代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime

@Override
public void remapUpdated(final Oid oid) {
  ensureThatArg(oid.hasPrevious(), is(true));
  final Oid previousOid = oid.getPrevious();
  if (LOG.isDebugEnabled()) {
    LOG.debug("remapping oid: " + oid + " with previous oid of: " + previousOid);
  }
  final ObjectAdapter lookedUpAdapter = oidAdapterMap.getAdapter(previousOid);
  if (lookedUpAdapter == null) {
    LOG.warn("could not locate previousOid: " + previousOid);
    return;
  }
  if (LOG.isDebugEnabled()) {
    LOG.debug("removing previous oid" + previousOid);
  }
  oidAdapterMap.remove(previousOid);
  // we can't replace the Oid on the looked-up adapter, so instead we
  // just make it the same value as the Oid we were originally passed in
  final Oid lookedUpAdapterOid = lookedUpAdapter.getOid();
  lookedUpAdapterOid.copyFrom(oid);
  // finally re-map the adapter
  oidAdapterMap.add(lookedUpAdapterOid, lookedUpAdapter);
}

代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime

@Override
public void remapUpdated(final Oid oid) {
  identities.remove(oid);
  final Oid previousOid = oid.getPrevious();
  final ObjectAdapter object = identities.get(previousOid);
  if (object == null) {
    return;
  }
  identities.remove(previousOid);
  final Oid oidFromObject = object.getOid();
  oidFromObject.copyFrom(oid);
  identities.put(oidFromObject, object);
}

代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime

@Test
public void testOidHasNoPrevious() throws Exception {
  assertNull(oid.getPrevious());
}

代码示例来源:origin: org.apache.isis.runtimes.dflt/runtime

LOG.debug("made persistent " + rootAdapter + "; was " + oid.getPrevious());

相关文章