本文整理汇总了Java中org.jooq.Record5类的典型用法代码示例。如果您正苦于以下问题:Java Record5类的具体用法?Java Record5怎么用?Java Record5使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Record5类属于org.jooq包,在下文中一共展示了Record5类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getOverviewInternal
import org.jooq.Record5; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private Result<Record5<Integer, String, String, String, DateTime>> getOverviewInternal(ChargePointQueryForm form) {
SelectQuery selectQuery = ctx.selectQuery();
selectQuery.addFrom(CHARGE_BOX);
selectQuery.addSelect(
CHARGE_BOX.CHARGE_BOX_PK,
CHARGE_BOX.CHARGE_BOX_ID,
CHARGE_BOX.DESCRIPTION,
CHARGE_BOX.OCPP_PROTOCOL,
CHARGE_BOX.LAST_HEARTBEAT_TIMESTAMP
);
if (form.isSetOcppVersion()) {
// http://dev.mysql.com/doc/refman/5.7/en/pattern-matching.html
selectQuery.addConditions(CHARGE_BOX.OCPP_PROTOCOL.like(form.getOcppVersion().getValue() + "_"));
}
if (form.isSetDescription()) {
selectQuery.addConditions(includes(CHARGE_BOX.DESCRIPTION, form.getDescription()));
}
if (form.isSetChargeBoxId()) {
selectQuery.addConditions(includes(CHARGE_BOX.CHARGE_BOX_ID, form.getChargeBoxId()));
}
switch (form.getHeartbeatPeriod()) {
case ALL:
break;
case TODAY:
selectQuery.addConditions(
date(CHARGE_BOX.LAST_HEARTBEAT_TIMESTAMP).eq(date(DateTime.now()))
);
break;
case YESTERDAY:
selectQuery.addConditions(
date(CHARGE_BOX.LAST_HEARTBEAT_TIMESTAMP).eq(date(DateTime.now().minusDays(1)))
);
break;
case EARLIER:
selectQuery.addConditions(
date(CHARGE_BOX.LAST_HEARTBEAT_TIMESTAMP).lessThan(date(DateTime.now().minusDays(1)))
);
break;
default:
throw new SteveException("Unknown enum type");
}
// Default order
selectQuery.addOrderBy(CHARGE_BOX.CHARGE_BOX_PK.asc());
return selectQuery.fetch();
}