本文整理了Java中dk.eobjects.metamodel.query.Query.select
方法的一些代码示例,展示了Query.select
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.select
方法的具体详情如下:
包路径:dk.eobjects.metamodel.query.Query
类名称:Query
方法名:select
暂无
代码示例来源:origin: dk.eobjects.commons/MetaModel
public Query selectCount() {
return select(SelectItem.getCountAllItem());
}
代码示例来源:origin: dk.eobjects.datacleaner/DataCleaner-core
/**
* Convenience method to create a base query for matrix values based on a
* specific column (where only the columns content is of interest).
*/
protected Query getBaseQuery(Column column) {
return new Query().from(column.getTable()).select(
new SelectItem(column)).selectCount().groupBy(column);
}
代码示例来源:origin: dk.eobjects.datacleaner/DataCleaner-core
/**
* Convenience method to create a base query for matrix values based on the
* configured columns (where the other columns are of interest).
*/
protected Query getBaseQuery() {
if (_columns.length > 0) {
Table table = _columns[0].getTable();
Query q = new Query().select(table.getColumns()).from(table);
return q;
}
return null;
}
代码示例来源:origin: dk.eobjects.datacleaner/DataCleaner-core
Query q = new Query().select(selectItem).selectCount().from(
_column.getTable()).where(
new FilterItem(items.toArray(new FilterItem[items.size()])))
代码示例来源:origin: dk.eobjects.metamodel/MetaModel-querypostprocessor
@Override
public DataSet materializeMainSchemaTable(Table table,
Column[] columns, int maxRows) {
DataContext dc = getDataContext(table);
Query q = new Query().select(columns).from(table);
if (maxRows >= 0) {
q.setMaxRows(maxRows);
}
return dc.executeQuery(q);
}
代码示例来源:origin: dk.eobjects.metamodel/MetaModel-jdbc
private long getRowCount(Query q) {
q = q.clone();
SelectItem countAllItem = SelectItem.getCountAllItem();
if (q.getGroupByClause().getItemCount() > 0) {
q = new Query().from(new FromItem(q).setAlias("sq")).select(
countAllItem);
} else {
q.getSelectClause().removeItems();
q.select(countAllItem);
}
Row row = MetaModelHelper.executeSingleRowQuery(_dataContext, q);
Number count = (Number) row.getValue(countAllItem);
return count.longValue();
}
代码示例来源:origin: dk.eobjects.commons/MetaModel
private long getRowCount(Query q) {
q = q.clone();
SelectItem countAllItem = SelectItem.getCountAllItem();
if (q.getGroupByClause().getItemCount() > 0) {
q = new Query().from(new FromItem(q).setAlias("sq")).select(
countAllItem);
} else {
q.getSelectClause().removeItems();
q.select(countAllItem);
}
Row row = MetaModelHelper.executeSingleRowQuery(_dataContext, q);
Number count = (Number) row.getValue(countAllItem);
return count.longValue();
}
代码示例来源:origin: dk.eobjects.commons/MetaModel
q.select(primaryColumns.toArray(new Column[primaryColumns.size()]));
q.select(foreignColumns.toArray(new Column[foreignColumns.size()]));
q.from(new FromItem(JoinType.LEFT, relationship));
if (_log.isDebugEnabled()) {
代码示例来源:origin: dk.eobjects.datacleaner/DataCleaner-core
q.select(columnsToQuery);
SelectItem countAllItem = SelectItem.getCountAllItem();
q.select(countAllItem);
q.groupBy(columnsToQuery);
DataSet data = dataContext.executeQuery(q);
代码示例来源: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.metamodel/MetaModel-xml
q.select(primaryColumns.toArray(new Column[primaryColumns.size()]));
q.select(foreignColumns.toArray(new Column[foreignColumns.size()]));
q.from(new FromItem(JoinType.LEFT, relationship));
if (_log.isDebugEnabled()) {
代码示例来源:origin: dk.eobjects.commons/MetaModel
.getForeignColumns();
SelectItem countAllItem = SelectItem.getCountAllItem();
Query q = new Query().select(foreignColumns).select(
countAllItem).from(table).groupBy(foreignColumns);
DataSet data = executeQuery(q);
代码示例来源:origin: dk.eobjects.metamodel/MetaModel-xml
Query q = new Query().select(foreignColumns).select(
countAllItem).from(table).groupBy(
foreignColumns);
代码示例来源:origin: dk.eobjects.metamodel/MetaModel-querypostprocessor
columnsToQuery = MetaModelHelper.getColumnsByType(columnsToQuery,
ColumnType.VARCHAR);
DataSet dataSet = executeQuery(new Query().select(columnsToQuery)
.from(table));
代码示例来源: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.commons/MetaModel
private List<Query> splitQueryBasedOnColumn(Column column) {
SelectItem maxItem = new SelectItem(FunctionType.MAX, column);
SelectItem minItem = new SelectItem(FunctionType.MIN, column);
Query q = new Query().from(column.getTable()).select(maxItem, minItem);
Row row = MetaModelHelper.executeSingleRowQuery(_dataContext, q);
long max = ceil((Number) row.getValue(maxItem));
代码示例来源:origin: dk.eobjects.metamodel/MetaModel-jdbc
private List<Query> splitQueryBasedOnColumn(Column column) {
SelectItem maxItem = new SelectItem(FunctionType.MAX, column);
SelectItem minItem = new SelectItem(FunctionType.MIN, column);
Query q = new Query().from(column.getTable()).select(maxItem, minItem);
Row row = MetaModelHelper.executeSingleRowQuery(_dataContext, q);
long max = ceil((Number) row.getValue(maxItem));
代码示例来源: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;
}
}
内容来源于网络,如有侵权,请联系作者删除!