本文整理了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
暂无
代码示例来源: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));
}
内容来源于网络,如有侵权,请联系作者删除!