当前位置: 首页>>代码示例>>Java>>正文


Java Result.isNotEmpty方法代码示例

本文整理汇总了Java中org.jooq.Result.isNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java Result.isNotEmpty方法的具体用法?Java Result.isNotEmpty怎么用?Java Result.isNotEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jooq.Result的用法示例。


在下文中一共展示了Result.isNotEmpty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSecretVersionsBySecretId

import org.jooq.Result; //导入方法依赖的package包/类
public Optional<ImmutableList<SecretContent>> getSecretVersionsBySecretId(long id,
    int versionIdx,
    int numVersions) {
  Result<SecretsContentRecord> r = dslContext.selectFrom(SECRETS_CONTENT)
      .where(SECRETS_CONTENT.SECRETID.eq(id))
      .orderBy(SECRETS_CONTENT.CREATEDAT.desc())
      .limit(versionIdx, numVersions)
      .fetch();

  if (r != null && r.isNotEmpty()) {
    ImmutableList.Builder<SecretContent> b = new ImmutableList.Builder<>();
    b.addAll(r.map(secretContentMapper));
    return Optional.of(b.build());
  } else {
    return Optional.empty();
  }
}
 
开发者ID:square,项目名称:keywhiz,代码行数:18,代码来源:SecretContentDAO.java

示例2: updateCrawlEntry

import org.jooq.Result; //导入方法依赖的package包/类
private void updateCrawlEntry(Environment env) {
    if (crawlerDbUserName == null || crawlerDbUrl == null || crawlerDbPassword == null) {
        return;
    }
    try (Connection conn = DriverManager.getConnection(crawlerDbUrl, crawlerDbUserName, crawlerDbPassword)) {
        DSLContext create = DSL.using(conn, SQLDialect.POSTGRES);

        Result<Record> records = create.select().from(CRAWL_ENTITIES)
                .where(CRAWL_ENTITIES.OO_ID.eq(env.getId()))
                .fetch();

        if (records.isNotEmpty()) {
            create.update(CRAWL_ENTITIES)
                    .set(CRAWL_ENTITIES.LAST_CRAWLED_AT, new Timestamp(System.currentTimeMillis()))
                    .where(CRAWL_ENTITIES.OO_ID.eq(env.getId()))
                    .execute();
        } else {
            create.insertInto(CRAWL_ENTITIES)
                    .set(CRAWL_ENTITIES.NS_PATH, env.getPath() + "/" + env.getName())
                    .set(CRAWL_ENTITIES.OO_ID, env.getId())
                    .execute();
        }

    } catch (Exception e) {
        e.printStackTrace();
    }
}
 
开发者ID:oneops,项目名称:oneops,代码行数:28,代码来源:CMSCrawler.java

示例3: query

import org.jooq.Result; //导入方法依赖的package包/类
private Record query(int voteLimit, Integer maxRows, Integer notFromLocation) {
	Result<Record> recList = query(voteLimit, null, maxRows, notFromLocation, null, null);
	if (recList.isNotEmpty()) {
		return recList.get((int) (Math.random() * recList.size()));
	}
	return null;
}
 
开发者ID:oglimmer,项目名称:lunchy,代码行数:8,代码来源:UpdatesDao.java

示例4: TellMessageTrigger

import org.jooq.Result; //导入方法依赖的package包/类
public static void TellMessageTrigger(PircBotX network, User user, Channel channel, String prefix) {
    String networkName = IRCUtils.getNetworkNameByNetwork(network);
    Result<Record> TellMessages = DatabaseUtils.getTellMessage(networkName, PermUtils.authUser(network, user.getNick()));
    if (TellMessages != null && TellMessages.isNotEmpty()) {
        if (channel != null) {
            IRCUtils.sendMessage(user, network, channel, "[" + user.getNick() + "] - Someone sent you a latent message while you were away! Please Check your PMs", prefix);
        }
        for (Record rec : TellMessages) {
            IRCUtils.sendMessage(user, network, null, "[" + rec.getValue(TELLMESSAGES.SENDER) + "] - " + rec.getValue(TELLMESSAGES.MESSAGE), null);
        }
        DatabaseUtils.removeTellMessage(networkName, PermUtils.authUser(network, user.getNick()));
    }
}
 
开发者ID:TechCavern,项目名称:WaveTact,代码行数:14,代码来源:TellMsgListener.java


注:本文中的org.jooq.Result.isNotEmpty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。