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

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

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

Oid.hasPrevious介绍

[英]Returns true if this oid contains a #getPrevious()value, specifically that the Oid was changed from transient to persistent.
[中]如果此oid包含#getPrevious()值,特别是oid已从瞬态更改为持久,则返回true。

代码示例

代码示例来源: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

@Test
public void whenValidPersistentWithTransientPreviousThenPreviousDoesNotItselfHaveAPrevious() {
  final SerialOid oid = SerialOid.deString("OID:12ABF3~TOID:12");
  final Oid previousOid = oid.getPrevious();
  assertThat(previousOid.hasPrevious(), is(false));
}

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

final Oid objectsOid = object.getOid();
Assert.assertNotNull(objectsOid);
if (objectsOid.hasPrevious()) {
  final Version version = object.getVersion();
  final String type = data.getType();

相关文章