com.psddev.dari.db.Query.option()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(209)

本文整理了Java中com.psddev.dari.db.Query.option方法的一些代码示例,展示了Query.option的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.option方法的具体详情如下:
包路径:com.psddev.dari.db.Query
类名称:Query
方法名:option

Query.option介绍

[英]Adds a custom option with the given key and value.
[中]添加具有给定键和值的自定义选项。

代码示例

代码示例来源:origin: perfectsense/dari

@Override
  protected <T> Query<T> filterQuery(Query<T> query) {
    return query.clone().option(Database.DISABLE_FUNNEL_CACHE_QUERY_OPTION, true).option(SqlDatabase.DISABLE_REPLICATION_CACHE_QUERY_OPTION, true);
  }
};

代码示例来源:origin: perfectsense/brightspot-cms

public static ToolUser getByTotpToken(String totpToken) {
  ToolUser user = Query.from(ToolUser.class).option(Database.DISABLE_FUNNEL_CACHE_QUERY_OPTION, true).where("totpToken = ?", totpToken).first();
  return user != null && user.totpTokenTime + 60000 > System.currentTimeMillis() ? user : null;
}

代码示例来源:origin: perfectsense/brightspot-cms

@Override
  protected <T> Query<T> filterQuery(Query<T> query) {
    return query.clone().master().resolveInvisible().option(Database.DISABLE_FUNNEL_CACHE_QUERY_OPTION, true);
  }
};

代码示例来源:origin: perfectsense/brightspot-cms

public static ToolUser getByChangePasswordToken(String changePasswordToken) {
  ToolUser user = Query.from(ToolUser.class).option(Database.DISABLE_FUNNEL_CACHE_QUERY_OPTION, true).where("changePasswordToken = ?", changePasswordToken).first();
  long expiration = Settings.getOrDefault(long.class, "cms/tool/changePasswordTokenExpirationInHours", 24L) * 60L * 60L * 1000L;
  return user != null && user.changePasswordTokenTime + expiration > System.currentTimeMillis() ? user : null;
}

代码示例来源:origin: perfectsense/brightspot-cms

public static ToolUser getByToken(String token) {
    ToolUser user = Query.from(ToolUser.class).option(Database.DISABLE_FUNNEL_CACHE_QUERY_OPTION, true).where("loginTokens/token = ?", token).first();
    return user != null && user.getLoginToken(token) != null ? user : null;
  }
}

代码示例来源:origin: perfectsense/dari

.where("_id = ?", unresolvedIds)
.using(database)
.option(State.REFERENCE_RESOLVING_QUERY_OPTION, parent)
.option(State.REFERENCE_FIELD_QUERY_OPTION, field)
.option(State.UNRESOLVED_TYPE_IDS_QUERY_OPTION, unresolvedTypeIds);

代码示例来源:origin: perfectsense/dari

.where("_id = ?", id)
    .using(this)
    .option(CONNECTION_QUERY_OPTION, connection)
    .option(RETURN_ORIGINAL_DATA_QUERY_OPTION, Boolean.TRUE)
    .option(USE_READ_DATA_SOURCE_QUERY_OPTION, Boolean.FALSE)
    .first();
if (oldObject == null) {

代码示例来源:origin: perfectsense/dari

Query<?> query = Query.fromAll().using(db).noCache().resolveToReferenceOnly().option(SqlDatabase.USE_JDBC_FETCH_SIZE_QUERY_OPTION, false);
if (!isGlobal) {
  Set<ObjectType> concreteTypes = new HashSet<>();

代码示例来源:origin: perfectsense/dari

.where("_id = ?", id)
.using(this)
.option(CONNECTION_QUERY_OPTION, connection)
.option(RETURN_ORIGINAL_DATA_QUERY_OPTION, Boolean.TRUE)
.master()
.noCache()

相关文章