本文整理了Java中org.molgenis.data.Entity.getInstant()
方法的一些代码示例,展示了Entity.getInstant()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Entity.getInstant()
方法的具体详情如下:
包路径:org.molgenis.data.Entity
类名称:Entity
方法名:getInstant
暂无
代码示例来源:origin: org.molgenis/molgenis-settings
@Override
public Instant getInstant(String attributeName) {
return getEntity().getInstant(attributeName);
}
代码示例来源:origin: org.molgenis/molgenis-data-validation
private static ConstraintViolation checkDateTime(
Entity entity, Attribute attribute, EntityType entityType) {
try {
entity.getInstant(attribute.getName());
return null;
} catch (Exception e) {
return createConstraintViolation(entity, attribute, entityType);
}
}
代码示例来源:origin: org.molgenis/molgenis-core-ui
@GetMapping(value = "/latest", produces = MediaType.APPLICATION_JSON_VALUE)
@ResponseBody
public List<Entity> findLastJobs() {
final List<Entity> jobs = new ArrayList<>();
Instant weekAgo = Instant.now().minus(7, ChronoUnit.DAYS).truncatedTo(ChronoUnit.DAYS);
User currentUser = userAccountService.getCurrentUser();
dataService
.getMeta()
.getEntityTypes()
.filter(this::isAllowedJobExecutionEntityType)
.forEach(
e -> {
Query<Entity> q =
dataService.query(e.getId()).ge(JobExecutionMetaData.SUBMISSION_DATE, weekAgo);
if (!currentUser.isSuperuser()) {
q.and().eq(USER, currentUser.getUsername());
}
dataService.findAll(e.getId(), q).forEach(jobs::add);
});
jobs.sort(
(job1, job2) ->
job2.getInstant(SUBMISSION_DATE).compareTo(job1.getInstant(SUBMISSION_DATE)));
if (jobs.size() > MAX_JOBS_TO_RETURN) {
return jobs.subList(0, MAX_JOBS_TO_RETURN);
}
return jobs;
}
代码示例来源:origin: org.molgenis/molgenis-web
break;
case DATE_TIME:
Instant instantValue = entity.getInstant(attributeName);
result.add(attributeName, context.serialize(instantValue));
break;
代码示例来源:origin: org.molgenis/molgenis-data-cache
break;
case DATE_TIME:
value = entity.getInstant(name);
break;
case BOOL:
代码示例来源:origin: org.molgenis/molgenis-data-rest
break;
case DATE_TIME:
Instant dateTimeValue = entity.getInstant(attrName);
responseData.put(attrName, dateTimeValue != null ? dateTimeValue.toString() : null);
break;
代码示例来源:origin: org.molgenis/molgenis-data-rest
entityMap.put(attrName, date != null ? date.toString() : null);
} else if (attrType == DATE_TIME) {
Instant date = entity.getInstant(attrName);
entityMap.put(attrName, date != null ? date.toString() : null);
} else if (attrType != XREF
代码示例来源:origin: org.molgenis/molgenis-js
Instant instant = entity.getInstant(attrName);
if (instant != null) {
value = instant.toEpochMilli();
代码示例来源:origin: org.molgenis/molgenis-data-validation
return entity.getLocalDate(attributeName);
case DATE_TIME:
return entity.getInstant(attributeName);
case BOOL:
return entity.getBoolean(attributeName);
代码示例来源:origin: org.molgenis/molgenis-data-postgresql
case DATE_TIME:
Instant instant = entity.getInstant(attrName);
return instant != null ? instant.truncatedTo(ChronoUnit.SECONDS).atOffset(UTC) : null;
case DECIMAL:
代码示例来源:origin: org.molgenis/molgenis-fair
case DATE_TIME:
calendar =
DATATYPE_FACTORY.newXMLGregorianCalendar(objectEntity.getInstant(name).toString());
model.add(subject, predicate, valueFactory.createLiteral(calendar));
break;
内容来源于网络,如有侵权,请联系作者删除!