本文整理了Java中com.psddev.dari.db.Query.mapEmbeddedKey
方法的一些代码示例,展示了Query.mapEmbeddedKey
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.mapEmbeddedKey
方法的具体详情如下:
包路径:com.psddev.dari.db.Query
类名称:Query
方法名:mapEmbeddedKey
[英]Maps the given key to a field of a type in the given environment. This is a helper method for database implementations and isn't meant for general consumption.
[中]将给定的键映射到给定环境中类型的字段。这是一种用于数据库实现的辅助方法,不适用于一般用途。
代码示例来源:origin: perfectsense/dari
/** @deprecated Use {@link #mapEmbeddedKey} instead. */
@Deprecated
public MappedKey mapKey(DatabaseEnvironment environment, String key) {
return mapEmbeddedKey(environment, key);
}
代码示例来源:origin: perfectsense/dari
private void addMappedKey(
Map<String, MappedKey> mappedKeys,
DatabaseEnvironment environment,
String key) {
if (!mappedKeys.containsKey(key)) {
mappedKeys.put(key, mapEmbeddedKey(environment, key));
}
}
代码示例来源:origin: perfectsense/dari
ComparisonPredicate comparisonPredicate = (ComparisonPredicate) predicate;
String operator = comparisonPredicate.getOperator();
String indexKey = query.mapEmbeddedKey(getEnvironment(), comparisonPredicate.getKey()).getIndexKey(null);
代码示例来源:origin: perfectsense/dari
/** Builds MongoDB query based on the given {@code query}. */
public DBObject buildMongoSort(Query<?> query) {
List<Sorter> sorters = query.getSorters();
if (sorters.isEmpty()) {
return new BasicDBObject();
}
BasicDBObject mongoSorter = new BasicDBObject();
for (Sorter sorter : sorters) {
String operator = sorter.getOperator();
if (Sorter.ASCENDING_OPERATOR.equals(operator)) {
String indexKey = query.mapEmbeddedKey(getEnvironment(), (String) sorter.getOptions().get(0)).getIndexKey(null);
mongoSorter.append(indexKey, 1);
} else if (Sorter.DESCENDING_OPERATOR.equals(operator)) {
String indexKey = query.mapEmbeddedKey(getEnvironment(), (String) sorter.getOptions().get(0)).getIndexKey(null);
mongoSorter.append(indexKey, -1);
} else {
throw new UnsupportedSorterException(this, sorter);
}
}
return mongoSorter;
}
代码示例来源:origin: perfectsense/dari
Query.MappedKey key = query.mapEmbeddedKey(getEnvironment(), fields[i]);
ObjectField field = key.getSubQueryKeyField();
if (field == null) {
代码示例来源:origin: perfectsense/dari
StringBuilder orderByBuilder = new StringBuilder(orderByClause);
Query.MappedKey mappedKey = query.mapEmbeddedKey(database.getEnvironment(), metricFieldName);
if (mappedKey.getField() == null) {
throw new Query.NoFieldException(query.getGroup(), metricFieldName);
代码示例来源:origin: perfectsense/dari
Query.MappedKey key = query.mapEmbeddedKey(getEnvironment(), fields[i]);
ObjectField field = key.getSubQueryKeyField();
if (field == null) {
代码示例来源:origin: perfectsense/dari
@Override
public double getSum(String field) {
Query.MappedKey mappedKey = this.query.mapEmbeddedKey(getEnvironment(), field);
ObjectField sumField = mappedKey.getField();
if (sumField.isMetric()) {
objectFields.add(query.mapEmbeddedKey(getEnvironment(), fieldName).getField());
代码示例来源:origin: perfectsense/dari
if (groupFields != null) {
for (String groupField : groupFields) {
Query.MappedKey mappedKey = query.mapEmbeddedKey(database.getEnvironment(), groupField);
if (mappedKey.getField() != null) {
if (mappedKey.getField().isMetric()) {
mappedKeys.put(Query.ID_KEY, query.mapEmbeddedKey(database.getEnvironment(), Query.ID_KEY));
groupJoins.put(Query.ID_KEY, getJoin(Query.ID_KEY));
mappedKeys.put(Query.DIMENSION_KEY, query.mapEmbeddedKey(database.getEnvironment(), Query.DIMENSION_KEY));
groupJoins.put(Query.DIMENSION_KEY, getJoin(Query.DIMENSION_KEY));
代码示例来源:origin: perfectsense/dari
Query.MappedKey key = query.mapEmbeddedKey(getEnvironment(), keyName.toString());
ObjectIndex useIndex = null;
代码示例来源:origin: perfectsense/dari
ComparisonPredicate comparison = (ComparisonPredicate) predicate;
for (ObjectIndex index : mapEmbeddedKey(environment, comparison.getKey()).getIndexes()) {
if (index.isVisibility()) {
for (Object value : comparison.resolveValues(database)) {
代码示例来源:origin: perfectsense/dari
Query.MappedKey mappedKey = query.mapEmbeddedKey(database.getEnvironment(), groupKey);
代码示例来源:origin: perfectsense/dari
Query.MappedKey mappedKey = query.mapEmbeddedKey(database.getEnvironment(), queryKey);
mappedKeys.put(queryKey, mappedKey);
selectIndex(queryKey, mappedKey);
keyNameBuilder.append(field.getInternalName());
Query.MappedKey key = query.mapEmbeddedKey(database.getEnvironment(), keyNameBuilder.toString());
ObjectIndex useIndex = null;
内容来源于网络,如有侵权,请联系作者删除!