org.jooq.TableField.between()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.8k)|赞(0)|评价(0)|浏览(173)

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

TableField.between介绍

暂无

代码示例

代码示例来源:origin: io.zipkin.java/storage-jdbc

.from(table)
  .where(ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME.eq(request.serviceName))
  .and(ZIPKIN_SPANS.START_TS.between(endTs - request.lookback * 1000, endTs));
 dsl.and(ZIPKIN_SPANS.DURATION.between(request.minDuration, request.maxDuration));
} else if (request.minDuration != null) {
 dsl.and(ZIPKIN_SPANS.DURATION.greaterOrEqual(request.minDuration));

代码示例来源:origin: io.zipkin.java/spanstore-jdbc

.from(table)
  .where(ZIPKIN_ANNOTATIONS.ENDPOINT_SERVICE_NAME.eq(request.serviceName))
  .and(ZIPKIN_SPANS.START_TS.between(endTs - request.lookback * 1000, endTs));
 dsl.and(ZIPKIN_SPANS.DURATION.between(request.minDuration, request.maxDuration));
} else if (request.minDuration != null){
 dsl.and(ZIPKIN_SPANS.DURATION.greaterOrEqual(request.minDuration));

代码示例来源:origin: io.zipkin.java/zipkin-storage-jdbc

.where(ZIPKIN_SPANS.START_TS.between(endTs - request.lookback * 1000, endTs));
 dsl.and(ZIPKIN_SPANS.DURATION.between(request.minDuration, request.maxDuration));
} else if (request.minDuration != null) {
 dsl.and(ZIPKIN_SPANS.DURATION.greaterOrEqual(request.minDuration));

代码示例来源:origin: org.wikibrainapi/wikibrain-pageview

@Override
public int getNumViews(LocalId pageId, DateTime startDate, DateTime endDate) throws DaoException {
  DSLContext context = getJooq();
  Timestamp startTime = new Timestamp(startDate.getMillis());
  Timestamp endTime = new Timestamp(endDate.getMillis());
  try {
    Cursor<Record> result = context.select().
        from(Tables.PAGEVIEW).
        where(Tables.PAGEVIEW.LANG_ID.eq(pageId.getLanguage().getId())).
        and(Tables.PAGEVIEW.TSTAMP.between(startTime, endTime)).
        and(Tables.PAGEVIEW.PAGE_ID.eq(pageId.getId())).
        fetchLazy(getFetchSize());
    int numViews = 0;
    for (Record record : result){
      numViews += record.getValue(Tables.PAGEVIEW.NUM_VIEWS);
    }
    return numViews;
  } finally {
    freeJooq(context);
  }
}

代码示例来源:origin: shilad/wikibrain

@Override
public int getNumViews(LocalId pageId, DateTime startDate, DateTime endDate) throws DaoException {
  DSLContext context = getJooq();
  Timestamp startTime = new Timestamp(startDate.getMillis());
  Timestamp endTime = new Timestamp(endDate.getMillis());
  try {
    Cursor<Record> result = context.select().
        from(Tables.PAGEVIEW).
        where(Tables.PAGEVIEW.LANG_ID.eq(pageId.getLanguage().getId())).
        and(Tables.PAGEVIEW.TSTAMP.between(startTime, endTime)).
        and(Tables.PAGEVIEW.PAGE_ID.eq(pageId.getId())).
        fetchLazy(getFetchSize());
    int numViews = 0;
    for (Record record : result){
      numViews += record.getValue(Tables.PAGEVIEW.NUM_VIEWS);
    }
    return numViews;
  } finally {
    freeJooq(context);
  }
}

代码示例来源:origin: io.zipkin.java/spanstore-jdbc

.where(lookback == null ?
  ZIPKIN_SPANS.START_TS.lessOrEqual(endTs) :
  ZIPKIN_SPANS.START_TS.between(endTs - lookback * 1000, endTs))

代码示例来源:origin: io.zipkin.java/storage-jdbc

.where(lookback == null ?
  ZIPKIN_SPANS.START_TS.lessOrEqual(endTs) :
  ZIPKIN_SPANS.START_TS.between(endTs - lookback * 1000, endTs))

代码示例来源:origin: io.zipkin.java/zipkin-storage-jdbc

.where(lookback == null ?
  ZIPKIN_SPANS.START_TS.lessOrEqual(endTs) :
  ZIPKIN_SPANS.START_TS.between(endTs - lookback * 1000, endTs))

代码示例来源:origin: org.wikibrainapi/wikibrain-pageview

@Override
public TIntIntMap getAllViews(Language language, DateTime startDate, DateTime endDate) throws DaoException {
  DSLContext context = getJooq();
  Timestamp startTime = new Timestamp(startDate.getMillis());
  Timestamp endTime = new Timestamp(endDate.getMillis());
  try {
    Cursor<Record> result = context.select().
        from(Tables.PAGEVIEW).
        where(Tables.PAGEVIEW.LANG_ID.eq(language.getId())).
        and(Tables.PAGEVIEW.TSTAMP.between(startTime, endTime)).
        fetchLazy(getFetchSize());
    TIntIntMap views = new TIntIntHashMap(
        gnu.trove.impl.Constants.DEFAULT_CAPACITY,
        gnu.trove.impl.Constants.DEFAULT_LOAD_FACTOR,
        -1, -1);
    for (Record record : result){
      views.adjustOrPutValue(
          record.getValue(Tables.PAGEVIEW.PAGE_ID),
          record.getValue(Tables.PAGEVIEW.NUM_VIEWS),
          record.getValue(Tables.PAGEVIEW.NUM_VIEWS));
    }
    return views;
  } finally {
    freeJooq(context);
  }
}

代码示例来源:origin: shilad/wikibrain

@Override
public TIntIntMap getAllViews(Language language, DateTime startDate, DateTime endDate) throws DaoException {
  DSLContext context = getJooq();
  Timestamp startTime = new Timestamp(startDate.getMillis());
  Timestamp endTime = new Timestamp(endDate.getMillis());
  try {
    Cursor<Record> result = context.select().
        from(Tables.PAGEVIEW).
        where(Tables.PAGEVIEW.LANG_ID.eq(language.getId())).
        and(Tables.PAGEVIEW.TSTAMP.between(startTime, endTime)).
        fetchLazy(getFetchSize());
    TIntIntMap views = new TIntIntHashMap(
        gnu.trove.impl.Constants.DEFAULT_CAPACITY,
        gnu.trove.impl.Constants.DEFAULT_LOAD_FACTOR,
        -1, -1);
    for (Record record : result){
      views.adjustOrPutValue(
          record.getValue(Tables.PAGEVIEW.PAGE_ID),
          record.getValue(Tables.PAGEVIEW.NUM_VIEWS),
          record.getValue(Tables.PAGEVIEW.NUM_VIEWS));
    }
    return views;
  } finally {
    freeJooq(context);
  }
}

代码示例来源:origin: com.walmartlabs.concord.server/concord-server

public boolean hasActiveProcess(DSLContext tx, Timestamp fromTime, Timestamp toTime) {
  int count = tx.selectCount()
      .from(PROCESS_QUEUE)
      .where(PROCESS_QUEUE.CREATED_AT.between(fromTime, toTime)
          .and(PROCESS_QUEUE.CURRENT_STATUS.notIn(ProcessStatus.FINISHED.name(),
              ProcessStatus.FAILED.name(),
              ProcessStatus.CANCELLED.name(),
              ProcessStatus.TIMED_OUT.name())))
      .fetchOne(Record1::value1);
  return count > 0;
}

代码示例来源:origin: io.zipkin.java/zipkin-storage-mysql

.where(lookback == null ?
  ZIPKIN_SPANS.START_TS.lessOrEqual(endTs) :
  ZIPKIN_SPANS.START_TS.between(endTs - lookback * 1000, endTs))

代码示例来源:origin: io.zipkin.java/zipkin-storage-mysql

SelectConditionStep<Record> dsl = context.selectDistinct(distinctFields)
  .from(table)
  .where(ZIPKIN_SPANS.START_TS.between(endTs - request.lookback * 1000, endTs));
 dsl.and(ZIPKIN_SPANS.DURATION.between(request.minDuration, request.maxDuration));
} else if (request.minDuration != null) {
 dsl.and(ZIPKIN_SPANS.DURATION.greaterOrEqual(request.minDuration));

相关文章