本文整理了Java中net.java.ao.Query.select
方法的一些代码示例,展示了Query.select
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.select
方法的具体详情如下:
包路径:net.java.ao.Query
类名称:Query
方法名:select
[英]Create a Query which will select the primary key field of the entity.
[中]创建一个查询,该查询将选择实体的主键字段。
代码示例来源:origin: net.java.dev.activeobjects/activeobjects
/**
* Create a {@link Query} which will select the primary key field of the entity.
*
* @return non-null Query
*/
public static Query select() {
return select(PRIMARY_KEY_FIELD);
}
代码示例来源:origin: net.java.dev.activeobjects/activeobjects-core
/**
* Create a {@link Query} which will select the primary key field of the entity.
*
* @return non-null Query
*/
public static Query select() {
return select(PRIMARY_KEY_FIELD);
}
代码示例来源:origin: net.java.dev.activeobjects/activeobjects-core
/**
* Counts all entities of the specified type. This method is actually a delegate for: <code>count(Class<?
* extends Entity>, Query)</code>
*
* @param type The type of the entities which should be counted.
* @return The number of entities of the specified type.
*/
public <K> int count(Class<? extends RawEntity<K>> type) throws SQLException {
return count(type, Query.select());
}
代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin
@Override
public List<SiteMapping> doInTransaction() {
return Arrays.asList(ao.find(SiteMapping.class, Query.select()));
}
});
代码示例来源:origin: net.java.dev.activeobjects/activeobjects
/**
* Counts all entities of the specified type. This method is actually a delegate for: <code>count(Class<?
* extends Entity>, Query)</code>
*
* @param type The type of the entities which should be counted.
* @return The number of entities of the specified type.
*/
public <K> int count(Class<? extends RawEntity<K>> type) throws SQLException {
return count(type, Query.select());
}
代码示例来源:origin: net.java.dev.activeobjects/activeobjects-core
/**
* Returns all entities of the given type. This actually peers the call to the {@link #find(Class, Query)} method.
*
* @param type The type of entity to retrieve.
* @return An array of all entities which correspond to the given type.
*/
public <T extends RawEntity<K>, K> T[] find(Class<T> type) throws SQLException {
return find(type, Query.select());
}
代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin
@Override
public Set<String> doInTransaction() {
IssueMapping[] mappings = ao.find(IssueMapping.class, Query.select().where(ISSUE_KEY + " IS NOT NULL"));
return Sets.newHashSet(Lists.transform(Arrays.asList(mappings), new Function<IssueMapping, String>() {
@Override
public String apply(IssueMapping input) {
return input != null ? input.getIssueKey() : null;
}
}));
}
});
代码示例来源:origin: com.atlassian.plugins/atlassian-connect-server-core
public Optional<AddonProperty> getPropertyValue(@Nonnull final String addonKey, @Nonnull final String propertyKey) {
AddonPropertyAO[] properties = ao.find(AddonPropertyAO.class, Query.select().where("PLUGIN_KEY = ? AND PROPERTY_KEY = ?", addonKey, propertyKey));
Optional<AddonPropertyAO> option = Optional.ofNullable(Iterables.getFirst(Arrays.asList(properties), null));
return option.flatMap(addonPropertyAO -> Optional.of(AddonPropertyFactory.fromAO(addonPropertyAO)));
}
代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin
@Override
public List<JobMapping> doInTransaction() {
return Arrays.asList(ao.find(JobMapping.class, Query.select().where(NAME + " = ?", name)));
}
});
代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin
@Override
public IssueMapping[] doInTransaction() {
return ao.find(IssueMapping.class, Query.select().where(PORJECT_KEY + " = ?", projectKey));
}
});
代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin
@Override
public IssueMapping[] doInTransaction() {
return ao.find(IssueMapping.class, Query.select().where(ISSUE_KEY + " = ?", issueKey));
}
});
代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin
@Override
public BuildMapping doInTransaction() {
BuildMapping[] mappings = ao.find(BuildMapping.class, Query.select().where(JOB_ID + " = ? AND " +
BUILD_NUMBER + " = ?", jobId, buildNumber));
if (mappings != null && mappings.length == 1) {
return mappings[0];
} else {
return null;
}
}
});
代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin
@Override
public List<IssueMapping> doInTransaction() {
IssueMapping[] mappings = ao.find(IssueMapping.class, Query.select().where(BUILD_ID + " = ?",
build.getId()));
return Arrays.asList(mappings);
}
});
代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin
@Override
public List<IssueMapping> doInTransaction() {
IssueMapping[] mappings = ao.find(IssueMapping.class, Query.select().where(JOB_ID + " = ?",
job.getId()));
return Arrays.asList(mappings);
}
});
代码示例来源:origin: com.atlassian.plugin.automation/automation-module
@Override
public Rule getRule(final String name)
{
final RuleEntity[] ruleEntity = ao.find(RuleEntity.class, Query.select().where("RULE_NAME = ?", name));
Rule ret = null;
if (ruleEntity != null && ruleEntity.length == 1)
{
ret = transformRule(ruleEntity[0]);
}
return ret;
}
代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin
@Override
public SiteMapping doInTransaction() {
SiteMapping[] mappings = ao.find(SiteMapping.class, Query.select().where(SiteMapping.APPLINK_ID + " = ?",
applicationId.get()));
if (mappings != null && mappings.length == 1) {
return mappings[0];
} else {
return null;
}
}
});
代码示例来源:origin: com.atlassian.plugins/base-hipchat-integration-plugin-api
@Override
public Option<AOHipChatLink> getLinkByUrlAndGroup(String apiUrl, int groupId) {
final Query query = Query.select()
.from(AOHipChatLink.class)
.where("GROUP_ID = ? and API_URL = ?",
groupId,
apiUrl
);
final AOHipChatLink[] links = ao.find(AOHipChatLink.class, query);
return first(ImmutableList.copyOf(links));
}
代码示例来源:origin: com.marvelution.bamboo.plugins/bamboo-sonar-tasks
@Override
public SonarServer doInTransaction() {
try {
return objects.find(SonarServer.class, Query.select().where("NAME = ?", name).limit(1))[0];
} catch (IndexOutOfBoundsException e) {
return null;
}
}
});
代码示例来源:origin: com.marvelution.jira.plugins/jira-jenkins-plugin
@Override
public JobMapping[] doInTransaction() {
return ao.find(JobMapping.class, Query.select()
.alias(JobMapping.class, "job")
.alias(SiteMapping.class, "site")
.from(JobMapping.class)
.join(SiteMapping.class, "site.ID = job." + SITE_ID)
.where(where.toString()));
}
});
代码示例来源:origin: Eernie/bitbucket-webhooks-plugin
public WebHookConfiguration[] getEnabledWebHookConfigurations(Repository repo, EventType eventType) {
return activeObjects.find(WebHookConfiguration.class, Query.select()
.where(COLUMN_REPO_ID + " = ? AND " + COLUMN_ENABLED + " = ? AND " + eventType.getQueryColumn() + " = ?",
repo.getId(), true, true)
.order(COLUMN_TITLE));
}
内容来源于网络,如有侵权,请联系作者删除!