com.j256.ormlite.stmt.Where.le()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(11.1k)|赞(0)|评价(0)|浏览(183)

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

Where.le介绍

[英]Add a '<=' clause so the column must be less-than or equals-to the value.
[中]添加“<=”子句,使该列必须小于或等于该值。

代码示例

代码示例来源:origin: magefree/mage

where.le("cardNumber", maxCardNumber);
clausesCount++;

代码示例来源:origin: org.mycontroller.standalone/mycontroller-core

@Override
public long countOf(AGGREGATION_TYPE aggregationType, long start, long end) {
  QueryBuilder<MetricsCounterTypeDevice, Object> queryBuilder = getDao().queryBuilder();
  try {
    return queryBuilder.where().gt(MetricsCounterTypeDevice.KEY_TIMESTAMP, start).and()
        .le(MetricsCounterTypeDevice.KEY_TIMESTAMP, end).and()
        .eq(MetricsCounterTypeDevice.KEY_AGGREGATION_TYPE, aggregationType).countOf();
  } catch (Exception ex) {
    _logger.error("Unable to execute countOf query", ex);
    return -1;
  }
}

代码示例来源:origin: org.mycontroller.standalone/mycontroller-core

@Override
public long countOf(AGGREGATION_TYPE aggregationType, long start, long end) {
  QueryBuilder<MetricsDoubleTypeDevice, Object> queryBuilder = getDao().queryBuilder();
  try {
    return queryBuilder.where().gt(MetricsDoubleTypeDevice.KEY_TIMESTAMP, start).and()
        .le(MetricsDoubleTypeDevice.KEY_TIMESTAMP, end).and()
        .eq(MetricsDoubleTypeDevice.KEY_AGGREGATION_TYPE, aggregationType).countOf();
  } catch (Exception ex) {
    _logger.error("Unable to execute countOf query", ex);
    return -1;
  }
}

代码示例来源:origin: org.mycontroller.standalone/mycontroller-core

@Override
public long countOf(AGGREGATION_TYPE aggregationType, long start, long end) {
  QueryBuilder<MetricsBatteryUsage, Object> queryBuilder = getDao().queryBuilder();
  try {
    return queryBuilder.where().gt(MetricsBatteryUsage.KEY_TIMESTAMP, start).and()
        .le(MetricsBatteryUsage.KEY_TIMESTAMP, end).and()
        .eq(MetricsBatteryUsage.KEY_AGGREGATION_TYPE, aggregationType).countOf();
  } catch (Exception ex) {
    _logger.error("Unable to execute countOf query", ex);
    return -1;
  }
}

代码示例来源:origin: org.mycontroller.standalone/mycontroller-core

@Override
  public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long end) {
    QueryBuilder<MetricsCounterTypeDevice, Object> queryBuilder = getDao().queryBuilder();
    try {
      return queryBuilder.where().gt(MetricsCounterTypeDevice.KEY_TIMESTAMP, start).and()
          .le(MetricsCounterTypeDevice.KEY_TIMESTAMP, end).and()
          .eq(MetricsCounterTypeDevice.KEY_AGGREGATION_TYPE, aggregationType).queryForFirst() != null;
    } catch (Exception ex) {
      _logger.error("Unable to execute countOf query", ex);
      return true;
    }
  }
}

代码示例来源:origin: org.mycontroller.standalone/mycontroller-core

@Override
  public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long end) {
    QueryBuilder<MetricsBatteryUsage, Object> queryBuilder = getDao().queryBuilder();
    try {
      return queryBuilder.where().gt(MetricsBatteryUsage.KEY_TIMESTAMP, start).and()
          .le(MetricsBatteryUsage.KEY_TIMESTAMP, end).and()
          .eq(MetricsBatteryUsage.KEY_AGGREGATION_TYPE, aggregationType).queryForFirst() != null;
    } catch (Exception ex) {
      _logger.error("Unable to execute countOf query", ex);
      return true;
    }
  }
}

代码示例来源:origin: mycontroller-org/mycontroller

@Override
public long countOf(AGGREGATION_TYPE aggregationType, long start, long end) {
  QueryBuilder<MetricsDoubleTypeDevice, Object> queryBuilder = getDao().queryBuilder();
  try {
    return queryBuilder.where().gt(MetricsDoubleTypeDevice.KEY_TIMESTAMP, start).and()
        .le(MetricsDoubleTypeDevice.KEY_TIMESTAMP, end).and()
        .eq(MetricsDoubleTypeDevice.KEY_AGGREGATION_TYPE, aggregationType).countOf();
  } catch (Exception ex) {
    _logger.error("Unable to execute countOf query", ex);
    throw new McDatabaseException(ex);
  }
}

代码示例来源:origin: mycontroller-org/mycontroller

@Override
public long countOf(AGGREGATION_TYPE aggregationType, long start, long end) {
  QueryBuilder<MetricsCounterTypeDevice, Object> queryBuilder = getDao().queryBuilder();
  try {
    return queryBuilder.where().gt(MetricsCounterTypeDevice.KEY_TIMESTAMP, start).and()
        .le(MetricsCounterTypeDevice.KEY_TIMESTAMP, end).and()
        .eq(MetricsCounterTypeDevice.KEY_AGGREGATION_TYPE, aggregationType).countOf();
  } catch (Exception ex) {
    _logger.error("Unable to execute countOf query", ex);
    throw new McDatabaseException(ex);
  }
}

代码示例来源:origin: mycontroller-org/mycontroller

@Override
public long countOf(AGGREGATION_TYPE aggregationType, long start, long end) {
  QueryBuilder<MetricsBatteryUsage, Object> queryBuilder = getDao().queryBuilder();
  try {
    return queryBuilder.where().gt(MetricsBatteryUsage.KEY_TIMESTAMP, start).and()
        .le(MetricsBatteryUsage.KEY_TIMESTAMP, end).and()
        .eq(MetricsBatteryUsage.KEY_AGGREGATION_TYPE, aggregationType).countOf();
  } catch (Exception ex) {
    _logger.error("Unable to execute countOf query", ex);
    throw new McDatabaseException(ex);
  }
}

代码示例来源:origin: org.mycontroller.standalone/mycontroller-core

@Override
  public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long end) {
    QueryBuilder<MetricsDoubleTypeDevice, Object> queryBuilder = getDao().queryBuilder();
    try {
      return queryBuilder.where()
          .gt(MetricsDoubleTypeDevice.KEY_TIMESTAMP, start).and()
          .le(MetricsDoubleTypeDevice.KEY_TIMESTAMP, end).and()
          .eq(MetricsDoubleTypeDevice.KEY_AGGREGATION_TYPE, aggregationType)
          .queryForFirst() != null;
    } catch (Exception ex) {
      _logger.error("Unable to execute countOf query", ex);
      return true;
    }
  }
}

代码示例来源:origin: mycontroller-org/mycontroller

@Override
  public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long end) {
    QueryBuilder<MetricsBatteryUsage, Object> queryBuilder = getDao().queryBuilder();
    try {
      return queryBuilder.where().gt(MetricsBatteryUsage.KEY_TIMESTAMP, start).and()
          .le(MetricsBatteryUsage.KEY_TIMESTAMP, end).and()
          .eq(MetricsBatteryUsage.KEY_AGGREGATION_TYPE, aggregationType).queryForFirst() != null;
    } catch (Exception ex) {
      _logger.error("Unable to execute countOf query", ex);
      throw new McDatabaseException(ex);
    }
  }
}

代码示例来源:origin: mycontroller-org/mycontroller

@Override
  public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long end) {
    QueryBuilder<MetricsCounterTypeDevice, Object> queryBuilder = getDao().queryBuilder();
    try {
      return queryBuilder.where().gt(MetricsCounterTypeDevice.KEY_TIMESTAMP, start).and()
          .le(MetricsCounterTypeDevice.KEY_TIMESTAMP, end).and()
          .eq(MetricsCounterTypeDevice.KEY_AGGREGATION_TYPE, aggregationType).queryForFirst() != null;
    } catch (Exception ex) {
      _logger.error("Unable to execute countOf query", ex);
      throw new McDatabaseException(ex);
    }
  }
}

代码示例来源:origin: mycontroller-org/mycontroller

@Override
  public boolean isRecordFound(AGGREGATION_TYPE aggregationType, long start, long end) {
    QueryBuilder<MetricsDoubleTypeDevice, Object> queryBuilder = getDao().queryBuilder();
    try {
      return queryBuilder.where()
          .gt(MetricsDoubleTypeDevice.KEY_TIMESTAMP, start).and()
          .le(MetricsDoubleTypeDevice.KEY_TIMESTAMP, end).and()
          .eq(MetricsDoubleTypeDevice.KEY_AGGREGATION_TYPE, aggregationType)
          .queryForFirst() != null;
    } catch (Exception ex) {
      _logger.error("Unable to execute countOf query", ex);
      throw new McDatabaseException(ex);
    }
  }
}

代码示例来源:origin: org.mycontroller.standalone/mycontroller-core

@Override
public List<MetricsCounterTypeDevice> getAggregationRequiredVariableIds(AGGREGATION_TYPE aggregationType,
    Long fromTimestamp, Long toTimestamp) {
  QueryBuilder<MetricsCounterTypeDevice, Object> queryBuilder = this.getDao().queryBuilder();
  try {
    return queryBuilder.distinct().selectColumns(MetricsCounterTypeDevice.KEY_SENSOR_VARIABLE_ID)
        .where().eq(MetricsCounterTypeDevice.KEY_AGGREGATION_TYPE, aggregationType).and()
        .gt(MetricsCounterTypeDevice.KEY_TIMESTAMP, fromTimestamp).and()
        .le(MetricsCounterTypeDevice.KEY_TIMESTAMP, toTimestamp)
        .query();
  } catch (SQLException ex) {
    _logger.error("Exception,", ex);
    return null;
  }
}

代码示例来源:origin: org.mycontroller.standalone/mycontroller-core

@Override
public List<MetricsBatteryUsage> getAggregationRequiredNodeIds(AGGREGATION_TYPE aggregationType,
    Long fromTimestamp, Long toTimestamp) {
  QueryBuilder<MetricsBatteryUsage, Object> queryBuilder = this.getDao().queryBuilder();
  try {
    return queryBuilder.distinct().selectColumns(MetricsBatteryUsage.KEY_NODE_ID)
        .where().eq(MetricsBatteryUsage.KEY_AGGREGATION_TYPE, aggregationType).and()
        .gt(MetricsBatteryUsage.KEY_TIMESTAMP, fromTimestamp).and()
        .le(MetricsBatteryUsage.KEY_TIMESTAMP, toTimestamp)
        .query();
  } catch (SQLException ex) {
    _logger.error("Exception,", ex);
    return null;
  }
}

代码示例来源:origin: org.mycontroller.standalone/mycontroller-core

@Override
public List<MetricsDoubleTypeDevice> getAggregationRequiredVariableIds(AGGREGATION_TYPE aggregationType,
    Long fromTimestamp, Long toTimestamp) {
  QueryBuilder<MetricsDoubleTypeDevice, Object> queryBuilder = this.getDao().queryBuilder();
  try {
    return queryBuilder.distinct().selectColumns(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID)
        .where().eq(MetricsDoubleTypeDevice.KEY_AGGREGATION_TYPE, aggregationType).and()
        .gt(MetricsDoubleTypeDevice.KEY_TIMESTAMP, fromTimestamp).and()
        .le(MetricsDoubleTypeDevice.KEY_TIMESTAMP, toTimestamp)
        .query();
  } catch (SQLException ex) {
    _logger.error("Exception,", ex);
    return null;
  }
}

代码示例来源:origin: mycontroller-org/mycontroller

@Override
public List<MetricsDoubleTypeDevice> getAggregationRequiredVariableIds(AGGREGATION_TYPE aggregationType,
    Long fromTimestamp, Long toTimestamp) {
  QueryBuilder<MetricsDoubleTypeDevice, Object> queryBuilder = this.getDao().queryBuilder();
  try {
    return queryBuilder.distinct().selectColumns(MetricsDoubleTypeDevice.KEY_SENSOR_VARIABLE_ID)
        .where().eq(MetricsDoubleTypeDevice.KEY_AGGREGATION_TYPE, aggregationType).and()
        .gt(MetricsDoubleTypeDevice.KEY_TIMESTAMP, fromTimestamp).and()
        .le(MetricsDoubleTypeDevice.KEY_TIMESTAMP, toTimestamp)
        .query();
  } catch (SQLException ex) {
    _logger.error("Exception,", ex);
    throw new McDatabaseException(ex);
  }
}

代码示例来源:origin: mycontroller-org/mycontroller

@Override
public List<MetricsCounterTypeDevice> getAggregationRequiredVariableIds(AGGREGATION_TYPE aggregationType,
    Long fromTimestamp, Long toTimestamp) {
  QueryBuilder<MetricsCounterTypeDevice, Object> queryBuilder = this.getDao().queryBuilder();
  try {
    return queryBuilder.distinct().selectColumns(MetricsCounterTypeDevice.KEY_SENSOR_VARIABLE_ID)
        .where().eq(MetricsCounterTypeDevice.KEY_AGGREGATION_TYPE, aggregationType).and()
        .gt(MetricsCounterTypeDevice.KEY_TIMESTAMP, fromTimestamp).and()
        .le(MetricsCounterTypeDevice.KEY_TIMESTAMP, toTimestamp)
        .query();
  } catch (SQLException ex) {
    _logger.error("Exception,", ex);
    throw new McDatabaseException(ex);
  }
}

代码示例来源:origin: mycontroller-org/mycontroller

@Override
public List<MetricsBatteryUsage> getAggregationRequiredNodeIds(AGGREGATION_TYPE aggregationType,
    Long fromTimestamp, Long toTimestamp) {
  QueryBuilder<MetricsBatteryUsage, Object> queryBuilder = this.getDao().queryBuilder();
  try {
    return queryBuilder.distinct().selectColumns(MetricsBatteryUsage.KEY_NODE_ID)
        .where().eq(MetricsBatteryUsage.KEY_AGGREGATION_TYPE, aggregationType).and()
        .gt(MetricsBatteryUsage.KEY_TIMESTAMP, fromTimestamp).and()
        .le(MetricsBatteryUsage.KEY_TIMESTAMP, toTimestamp)
        .query();
  } catch (SQLException ex) {
    _logger.error("Exception,", ex);
    throw new McDatabaseException(ex);
  }
}

代码示例来源:origin: j256/ormlite-core

@Test
public void testLe() throws Exception {
  Where<Foo, String> where = new Where<Foo, String>(createTableInfo(), null, databaseType);
  int val = 112;
  where.le(Foo.VAL_COLUMN_NAME, val);
  testOperation(where, Foo.VAL_COLUMN_NAME, "<=", val);
}

相关文章