本文整理了Java中com.j256.ormlite.stmt.Where.le()
方法的一些代码示例,展示了Where.le()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Where.le()
方法的具体详情如下:
包路径:com.j256.ormlite.stmt.Where
类名称: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);
}
内容来源于网络,如有侵权,请联系作者删除!