本文整理了Java中com.psddev.dari.db.Query.mapEmbeddedKeys
方法的一些代码示例,展示了Query.mapEmbeddedKeys
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.mapEmbeddedKeys
方法的具体详情如下:
包路径:com.psddev.dari.db.Query
类名称:Query
方法名:mapEmbeddedKeys
[英]Maps all keys used in this query to the fields of the types 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 #mapEmbeddedKeys} instead. */
@Deprecated
public Map<String, MappedKey> mapKeys(DatabaseEnvironment environment) {
return mapEmbeddedKeys(environment);
}
}
代码示例来源:origin: perfectsense/dari
/**
* Creates an instance that can translate the given {@code query}
* with the given {@code database}.
*/
public SqlQuery(
SqlDatabase initialDatabase,
Query<?> initialQuery,
String initialAliasPrefix) {
database = initialDatabase;
query = initialQuery;
aliasPrefix = initialAliasPrefix;
vendor = database.getVendor();
recordIdField = aliasedField("r", SqlDatabase.ID_COLUMN);
recordTypeIdField = aliasedField("r", SqlDatabase.TYPE_ID_COLUMN);
recordInRowIndexField = aliasedField("r", SqlDatabase.IN_ROW_INDEX_COLUMN);
mappedKeys = query.mapEmbeddedKeys(database.getEnvironment());
selectedIndexes = new HashMap<String, ObjectIndex>();
for (Map.Entry<String, Query.MappedKey> entry : mappedKeys.entrySet()) {
selectIndex(entry.getKey(), entry.getValue());
}
}
代码示例来源:origin: perfectsense/dari
/**
* Creates an instance that can translate the given {@code query}
* with the given {@code database}.
*/
public SqlQuery(AbstractSqlDatabase database, Query<?> query, String aliasPrefix) {
this.database = database;
this.query = query;
this.aliasPrefix = aliasPrefix;
dslContext = DSL.using(database.getDialect());
tableRenderContext = dslContext.renderContext().paramType(ParamType.INLINED).declareTables(true);
renderContext = dslContext.renderContext().paramType(ParamType.INLINED);
recordTableAlias = aliasPrefix + "r";
recordTable = DSL.table(DSL.name(database.recordTable.getName())).as(recordTableAlias);
recordIdField = DSL.field(DSL.name(recordTableAlias, database.recordIdField.getName()), database.uuidType());
recordTypeIdField = DSL.field(DSL.name(recordTableAlias, database.recordTypeIdField.getName()), database.uuidType());
mappedKeys = query.mapEmbeddedKeys(database.getEnvironment());
selectedIndexes = new HashMap<>();
for (Map.Entry<String, Query.MappedKey> entry : mappedKeys.entrySet()) {
selectIndex(entry.getKey(), entry.getValue());
}
}
内容来源于网络,如有侵权,请联系作者删除!