org.apache.isis.core.metamodel.adapter.version.Version.create()方法的使用及代码示例

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

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

Version.create介绍

暂无

代码示例

代码示例来源:origin: org.apache.isis.core/isis-core-runtime

static Version getVersionIfAny(final Persistable pojo, final AuthenticationSession authenticationSession) {
  Object jdoVersion = pojo.dnGetVersion();
  if(jdoVersion instanceof Long) {
    final Long longVersion = (Long) jdoVersion;
    return Version.create(longVersion, authenticationSession.getUserName(), (Date) null);
  }
  if(jdoVersion instanceof java.sql.Timestamp) {
    final Timestamp timestampVersion = (Timestamp) jdoVersion;
    return Version.create(timestampVersion.getTime(), authenticationSession.getUserName(), (Date) null);
  }
  return null;
}

代码示例来源:origin: org.apache.isis.core/isis-core-metamodel

@Override
protected List<Version> getObjectsWithDifferentValue() {
  return Arrays.asList(
        Version.create(124L, null, (Long)null), 
        Version.create(125L, null, (Long)null) 
      );
}

代码示例来源:origin: org.apache.isis.core/isis-core-metamodel

@Override
protected List<Version> getObjectsWithSameValue() {
  return Arrays.asList(
        Version.create(123L, null, (Long)null), 
        Version.create(123L, "jimmy", (Long)null), 
        Version.create(123L, null, new Date().getTime())
      ); 
}

代码示例来源:origin: org.apache.isis.core/isis-core-metamodel

@Test
public void whenEqual() throws Exception {
  version1 = Version.create(123L);
  version2 = Version.create(123L);
  assertThat(version1.different(version2), is(false));
}

代码示例来源:origin: org.apache.isis.core/isis-core-metamodel

@Test
public void whenNotEqual() throws Exception {
  version1 = Version.create(123L);
  version2 = Version.create(124L);
  assertThat(version1.different(version2), is(true));
}

相关文章