本文整理了Java中dk.eobjects.metamodel.query.Query.where
方法的一些代码示例,展示了Query.where
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.where
方法的具体详情如下:
包路径:dk.eobjects.metamodel.query.Query
类名称:Query
方法名:where
暂无
代码示例来源:origin: dk.eobjects.datacleaner/DataCleaner-core
private void generateDetailSources(MatrixValue matrixValue,
final Column column, final String value) {
Query query = getBaseQuery();
if (value != null && value.indexOf('\'') != -1) {
// We have to approximate with a LIKE filter and
// then postprocess because the value can't contain
// single quote (#197)
String wildcardValue = value.replace('\'', '%');
query.where(column, OperatorType.LIKE, wildcardValue);
matrixValue.addDetailRowFilter(new IRowFilter() {
public boolean accept(Row row) {
return value.equals(row.getValue(column));
}
});
} else {
query.where(column, OperatorType.EQUALS_TO, value);
}
matrixValue.setDetailSource(query);
}
代码示例来源:origin: dk.eobjects.commons/MetaModel
public Query where(Column column, OperatorType operatorType, Object operand) {
SelectItem selectItem = _selectClause.getSelectItem(column);
if (selectItem == null) {
selectItem = new SelectItem(column);
}
return where(new FilterItem(selectItem, operatorType, operand));
}
代码示例来源:origin: dk.eobjects.datacleaner/DataCleaner-core
if (column.getType() == ColumnType.DATE
|| column.getType() == ColumnType.TIMESTAMP) {
q.where(column, OperatorType.HIGHER_THAN,
new LocalDate(year - 1, 12, 31).toDateTimeAtStartOfDay());
q.where(column, OperatorType.LOWER_THAN, new LocalDate(
year + 1, 1, 1).toDateTimeAtStartOfDay());
代码示例来源:origin: dk.eobjects.datacleaner/DataCleaner-core
_column.getTable()).where(
new FilterItem(items.toArray(new FilterItem[items.size()])))
.groupBy(new GroupByItem(selectItem));
代码示例来源:origin: dk.eobjects.datacleaner/DataCleaner-core
@Override
protected List<IMatrix> getResultMatrices() {
ArrayList<IMatrix> result = new ArrayList<IMatrix>();
for (int i = 0; i < _columns.length; i++) {
Column column = _columns[i];
Map<String, Long> valueMap = _repeatedValues.get(column);
MatrixBuilder mb = new MatrixBuilder();
mb.addColumn(column.getName() + " count");
mb.addColumn(column.getName() + " %");
for (Entry<String, Long> entry : valueMap.entrySet()) {
Long repeatCount = entry.getValue();
String value = entry.getKey();
int repeatPercentage = (int) (repeatCount * 100 / _totalCount);
if (repeatPercentage >= _significanceRate) {
MatrixValue[] matrixValues = mb.addRow(value, repeatCount,
repeatPercentage + "%");
matrixValues[0].setDetailSource(new Query().from(
column.getTable()).select(_columns).where(
new FilterItem(new SelectItem(column),
OperatorType.EQUALS_TO, value)));
}
}
if (!mb.isEmpty()) {
mb.sortColumn(0, MatrixBuilder.DESCENDING);
result.add(mb.getMatrix());
}
}
return result;
}
代码示例来源:origin: dk.eobjects.commons/MetaModel
FilterItem orFilterItem = new FilterItem(lowerThanFilter,
nullFilter);
q.where(orFilterItem);
} else if (i + 1 == numSplits) {
q.where(orFilterItem);
} else {
higherThanFilter = new FilterItem(higherThanFilter,
lowerThanFilter = new FilterItem(lowerThanFilter,
equalsFilter);
q.where(higherThanFilter);
q.where(lowerThanFilter);
代码示例来源:origin: dk.eobjects.metamodel/MetaModel-jdbc
FilterItem orFilterItem = new FilterItem(lowerThanFilter,
nullFilter);
q.where(orFilterItem);
} else if (i + 1 == numSplits) {
q.where(orFilterItem);
} else {
higherThanFilter = new FilterItem(higherThanFilter,
lowerThanFilter = new FilterItem(lowerThanFilter,
equalsFilter);
q.where(higherThanFilter);
q.where(lowerThanFilter);
代码示例来源:origin: dk.eobjects.datacleaner/DataCleaner-core
.select(_columns).where(
new FilterItem(new SelectItem(column),
OperatorType.EQUALS_TO, null)));
if (column.getType() == null || column.getType().isLiteral()) {
values[2].setDetailSource(new Query().from(
column.getTable()).select(_columns).where(
new FilterItem(new SelectItem(column),
OperatorType.EQUALS_TO, "")));
代码示例来源:origin: dk.eobjects.datacleaner/DataCleaner-core
.valueToString(s.getVariance()));
matrixValues[0].setDetailSource(getBaseQuery().where(
new FilterItem(new SelectItem(_columns[i]),
OperatorType.EQUALS_TO, highestValue)));
matrixValues[1].setDetailSource(getBaseQuery().where(
new FilterItem(new SelectItem(_columns[i]),
OperatorType.EQUALS_TO, lowestValue)));
代码示例来源:origin: dk.eobjects.commons/MetaModel
@Override
public Query clone() {
Query q = new Query();
q.setMaxRows(_maxRows);
q.getSelectClause().setDistinct(_selectClause.isDistinct());
for (FromItem item : _fromClause.getItems()) {
q.from(item.clone());
}
for (SelectItem item : _selectClause.getItems()) {
q.select(item.clone());
}
for (FilterItem item : _whereClause.getItems()) {
q.where(item.clone());
}
for (GroupByItem item : _groupByClause.getItems()) {
q.groupBy(item.clone());
}
for (FilterItem item : _havingClause.getItems()) {
q.having(item.clone());
}
for (OrderByItem item : _orderByClause.getItems()) {
q.orderBy(item.clone());
}
return q;
}
}
内容来源于网络,如有侵权,请联系作者删除!