本文整理了Java中com.j256.ormlite.stmt.Where.gt()
方法的一些代码示例,展示了Where.gt()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Where.gt()
方法的具体详情如下:
包路径:com.j256.ormlite.stmt.Where
类名称:Where
方法名:gt
[英]Add a '>' clause so the column must be greater-than the value.
[中]添加一个'>'子句,使该列必须大于该值。
代码示例来源:origin: magefree/mage
public List<TableRecord> getAfter(long endTimeMs) {
try {
QueryBuilder<TableRecord, Object> qb = dao.queryBuilder();
qb.where().gt("endTimeMs", endTimeMs);
qb.orderBy("endTimeMs", true);
return dao.query(qb.prepare());
} catch (SQLException ex) {
Logger.getLogger(TableRecordRepository.class).error("Error getting table_records from DB - ", ex);
}
return null;
}
代码示例来源:origin: geeksonsecurity/android-overlay-protection
private void clearHistory() {
try {
Dao<DetectedOverlay, Integer> detectedOverlayDao = DatabaseHelper.getHelper(getActivity()).getDetectedOverlayDao();
DeleteBuilder<DetectedOverlay, Integer> deleteBuilder = detectedOverlayDao.deleteBuilder();
deleteBuilder.where().gt("id", 0);
int deleted = deleteBuilder.delete();
Log.i(getTag(), "Deleted " + deleted + " entries from DetectedOverlay");
} catch (SQLException e) {
Log.e(getTag(), "Failed to deleted entries", e);
}
mAdapter.clear();
}
代码示例来源: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 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 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: 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: 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 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 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: j256/ormlite-core
@Test
public void testGt() throws Exception {
Where<Foo, String> where = new Where<Foo, String>(createTableInfo(), null, databaseType);
int val = 112;
where.gt(Foo.VAL_COLUMN_NAME, val);
testOperation(where, Foo.VAL_COLUMN_NAME, ">", val);
}
代码示例来源: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);
}
}
内容来源于网络,如有侵权,请联系作者删除!