本文整理汇总了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();
}
}
示例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();
}
}
示例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;
}
示例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()));
}
}