本文整理了Java中com.j256.ormlite.stmt.Where.ge()
方法的一些代码示例,展示了Where.ge()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Where.ge()
方法的具体详情如下:
包路径:com.j256.ormlite.stmt.Where
类名称:Where
方法名:ge
[英]Add a '>=' clause so the column must be greater-than or equals-to the value.
[中]添加“>=”子句,使列必须大于或等于该值。
代码示例来源:origin: magefree/mage
where.ge("cardNumber", minCardNumber);
clausesCount++;
代码示例来源:origin: zulip/zulip-android
public static MessageRange getRangeContaining(int value,
RuntimeExceptionDao<MessageRange, Integer> messageRangeDao) {
List<MessageRange> ranges;
try {
ranges = messageRangeDao.queryBuilder().where().le("low", value)
.and().ge("high", value).query();
if (ranges.size() == 1) {
return ranges.get(0);
} else if (!ranges.isEmpty()) {
Log.wtf("rangecheck",
"Expected one range, got " + ranges.size()
+ " when looking for ID " + value);
}
} catch (SQLException e) {
// This is nonfatal.
ZLog.logException(e);
}
return null;
}
代码示例来源:origin: zulip/zulip-android
public Void call() throws Exception {
Where<MessageRange, Integer> where = messageRangeDao
.queryBuilder().orderBy("low", true).where();
@SuppressWarnings("unchecked")
List<MessageRange> ranges = where.or(
where.and(where.ge("high", low - 1),
where.le("high", high + 1)),
where.and(where.ge("low", low - 1),
where.le("low", high + 1))).query();
MessageRange rng = new MessageRange(low, high);
if (!ranges.isEmpty()) {
Log.i("", "our low: " + rng.low + ", our high: "
+ rng.high);
int dbLow = ranges.get(0).low;
int dbHigh = ranges.get(ranges.size() - 1).high;
Log.i("", "their low: " + dbLow + ", their high: "
+ dbHigh);
if (dbLow < rng.low) {
rng.low = dbLow;
}
if (dbHigh > rng.high) {
rng.high = dbHigh;
}
messageRangeDao.delete(ranges);
}
messageRangeDao.createOrUpdate(rng);
return null;
}
});
代码示例来源:origin: stackoverflow.com
where.and();
where.ge(BuyPostItem.FIELD_EXPECTED_PRICE, filter.getMinPrice());
hasAnythingBeforeThis = true;
代码示例来源:origin: j256/ormlite-core
@Test
public void testGe() throws Exception {
Where<Foo, String> where = new Where<Foo, String>(createTableInfo(), null, databaseType);
int val = 112;
where.ge(Foo.VAL_COLUMN_NAME, val);
testOperation(where, Foo.VAL_COLUMN_NAME, ">=", val);
}
代码示例来源:origin: mycontroller-org/mycontroller
protected void updatePurgeCondition(Where<?, Object> where, String key, Object value,
OPERATOR operator) throws SQLException {
switch (operator) {
case EQ:
where.eq(key, value);
break;
case GT:
where.gt(key, value);
break;
case LT:
where.lt(key, value);
break;
case GE:
where.ge(key, value);
break;
case LE:
where.le(key, value);
break;
case NE:
where.ne(key, value);
break;
default:
where.eq(key, value);
break;
}
}
代码示例来源:origin: mil.nga.geopackage/geopackage-core
where.eq(GeometryIndex.COLUMN_TABLE_NAME, tableName).and()
.le(GeometryIndex.COLUMN_MIN_X, maxX).and()
.ge(GeometryIndex.COLUMN_MAX_X, minX).and()
.le(GeometryIndex.COLUMN_MIN_Y, maxY).and()
.ge(GeometryIndex.COLUMN_MAX_Y, minY);
double maxZ = envelope.getMaxZ() + tolerance;
where.and().le(GeometryIndex.COLUMN_MIN_Z, maxZ).and()
.ge(GeometryIndex.COLUMN_MAX_Z, minZ);
double maxM = envelope.getMaxM() + tolerance;
where.and().le(GeometryIndex.COLUMN_MIN_M, maxM).and()
.ge(GeometryIndex.COLUMN_MAX_M, minM);
代码示例来源:origin: org.mycontroller.standalone/mycontroller-core
@Override
public List<MetricsBinaryTypeDevice> getAll(MetricsBinaryTypeDevice metric) {
try {
QueryBuilder<MetricsBinaryTypeDevice, Object> queryBuilder = this.getDao().queryBuilder();
Where<MetricsBinaryTypeDevice, Object> where = queryBuilder.where();
where.eq(MetricsBinaryTypeDevice.KEY_SENSOR_VARIABLE_ID, metric.getSensorVariable().getId());
if (metric.getStart() != null) {
where.and().ge(MetricsBinaryTypeDevice.KEY_TIMESTAMP, metric.getStart());
}
if (metric.getEnd() != null) {
where.and().le(MetricsBinaryTypeDevice.KEY_TIMESTAMP, metric.getEnd());
}
queryBuilder.orderBy(MetricsBinaryTypeDevice.KEY_TIMESTAMP, true);
return queryBuilder.query();
} catch (SQLException ex) {
_logger.error("unable to get, metric:{}", metric, ex);
}
return null;
}
代码示例来源:origin: ngageoint/geopackage-android
qb.where().ge(Contents.COLUMN_MIN_X, 0).or()
.ge(Contents.COLUMN_MIN_Y, 0);
PreparedQuery<Contents> preparedQuery = qb.prepare();
List<Contents> queryContents = dao.query(preparedQuery);
ub.updateColumnValue(Contents.COLUMN_MIN_X, updatedMinimum);
ub.updateColumnValue(Contents.COLUMN_MIN_Y, updatedMinimum);
ub.where().ge(Contents.COLUMN_MIN_X, 0).or()
.ge(Contents.COLUMN_MIN_Y, 0);
PreparedUpdate<Contents> update = ub.prepare();
int updated = dao.update(update);
代码示例来源:origin: mycontroller-org/mycontroller
@Override
public List<MetricsBinaryTypeDevice> getAll(MetricsBinaryTypeDevice metric) {
try {
QueryBuilder<MetricsBinaryTypeDevice, Object> queryBuilder = this.getDao().queryBuilder();
Where<MetricsBinaryTypeDevice, Object> where = queryBuilder.where();
where.eq(MetricsBinaryTypeDevice.KEY_SENSOR_VARIABLE_ID, metric.getSensorVariable().getId());
if (metric.getStart() != null) {
where.and().ge(MetricsBinaryTypeDevice.KEY_TIMESTAMP, metric.getStart());
}
if (metric.getEnd() != null) {
where.and().le(MetricsBinaryTypeDevice.KEY_TIMESTAMP, metric.getEnd());
}
queryBuilder.orderBy(MetricsBinaryTypeDevice.KEY_TIMESTAMP, true);
return queryBuilder.query();
} catch (SQLException ex) {
_logger.error("unable to get, metric:{}", metric, ex);
throw new McDatabaseException(ex);
}
}
代码示例来源:origin: mycontroller-org/mycontroller
where.ge(MetricsBinaryTypeDevice.KEY_TIMESTAMP, metric.getStart());
whereCount++;
代码示例来源:origin: ngageoint/geopackage-android
ub.updateColumnValue(SpatialReferenceSystem.COLUMN_DESCRIPTION,
updatedDescription);
ub.where().ge(SpatialReferenceSystem.COLUMN_ID, 0);
PreparedUpdate<SpatialReferenceSystem> update = ub.prepare();
int updated = dao.update(update);
代码示例来源:origin: mycontroller-org/mycontroller
where.ge(MetricsGPSTypeDevice.KEY_TIMESTAMP, metric.getStart());
whereCount++;
代码示例来源:origin: org.mycontroller.standalone/mycontroller-core
where.ge(MetricsGPSTypeDevice.KEY_TIMESTAMP, metric.getStart());
whereCount++;
代码示例来源:origin: org.mycontroller.standalone/mycontroller-core
where.ge(MetricsBinaryTypeDevice.KEY_TIMESTAMP, metric.getStart());
whereCount++;
代码示例来源:origin: org.mycontroller.standalone/mycontroller-core
where.ge(MetricsCounterTypeDevice.KEY_TIMESTAMP, metric.getStart());
whereCount++;
代码示例来源:origin: mycontroller-org/mycontroller
where.ge(MetricsCounterTypeDevice.KEY_TIMESTAMP, metric.getStart());
whereCount++;
代码示例来源:origin: com.j256.ormlite/ormlite-jdbc
assertEquals(foo1, results.get(0));
qb.where().ge(Foo.VAL_COLUMN_NAME, foo1.val);
results = fooDao.query(qb.prepare());
assertEquals(2, results.size());
assertEquals(foo2, results.get(1));
qb.where().ge(Foo.VAL_COLUMN_NAME, foo1.val - 1);
results = fooDao.query(qb.prepare());
assertEquals(2, results.size());
assertEquals(foo2, results.get(1));
qb.where().ge(Foo.VAL_COLUMN_NAME, foo2.val);
results = fooDao.query(qb.prepare());
assertEquals(1, results.size());
代码示例来源:origin: mycontroller-org/mycontroller
where.ge(MetricsDoubleTypeDevice.KEY_TIMESTAMP, metric.getStart());
whereCount++;
代码示例来源:origin: com.j256.ormlite/ormlite-jdbc
@Test
public void testIteratorPreparedQuery() throws Exception {
final Dao<Foo, Integer> fooDao = createDao(Foo.class, true);
// do an insert of bunch of items
final int numItems = 100;
fooDao.callBatchTasks(new InsertCallable(numItems, fooDao));
int lastX = 10;
PreparedQuery<Foo> preparedQuery =
fooDao.queryBuilder().where().ge(Foo.VAL_FIELD_NAME, numItems - lastX).prepare();
// now delete them with the iterator to test page-size
CloseableIterator<Foo> iterator = fooDao.iterator(preparedQuery);
try {
int itemC = 0;
while (iterator.hasNext()) {
iterator.next();
itemC++;
}
assertEquals(lastX, itemC);
} finally {
iterator.close();
}
}
内容来源于网络,如有侵权,请联系作者删除!