本文整理了Java中org.sonatype.nexus.repository.storage.Query
类的一些代码示例,展示了Query
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query
类的具体详情如下:
包路径:org.sonatype.nexus.repository.storage.Query
类名称:Query
[英]Helper for constructing orientDB queries.
[中]用于构造orientDB查询的助手。
代码示例来源:origin: org.sonatype.nexus/nexus-repository
public Query build() {
final StringBuilder str = where;
return new Query(clean(str), clean(suffix), Collections.unmodifiableMap(parameters)
);
}
代码示例来源:origin: org.sonatype.nexus/nexus-repository
@Override
public Iterable<Component> browseComponents(final Query query, final Bucket bucket) {
return componentEntityAdapter.browseByQueryAsync(db, query.getWhere(), query.getParameters(),
ImmutableList.of(bucket), query.getQuerySuffix());
}
代码示例来源:origin: sonatype-nexus-community/nexus-repository-composer
@Nullable
private Component findComponent(final StorageTx tx, final String group, final String name, final String version) {
Iterable<Component> components = tx.findComponents(Query.builder()
.where(P_GROUP).eq(group)
.and(P_NAME).eq(name)
.and(P_VERSION).eq(version)
.build(),
singletonList(getRepository()));
if (components.iterator().hasNext()) {
return components.iterator().next();
}
return null;
}
代码示例来源:origin: sonatype-nexus-community/nexus-repository-helm
/**
* Find assets for Helm components (charts)
*
* @return found assets or null if not found
*/
@Nullable
public Iterable<Asset> browseComponentAssets(final StorageTx tx,
final Bucket bucket)
{
Builder builder = builder()
.where(P_COMPONENT).isNotNull();
Query query = builder.build();
return tx.browseAssets(query, bucket);
}
代码示例来源:origin: sonatype-nexus-community/nexus-repository-helm
/**
* Find a component by its name and tag (version)
*
* @return found component or null if not found
*/
@Nullable
public Component findComponent(final StorageTx tx,
final Repository repository,
final String name,
final String version)
{
Iterable<Component> components = tx.findComponents(
Query.builder()
.where(P_NAME).eq(name)
.and(P_VERSION).eq(version)
.build(),
singletonList(repository)
);
if (components.iterator().hasNext()) {
return components.iterator().next();
}
return null;
}
代码示例来源:origin: org.sonatype.nexus/nexus-repository
@Override
@Guarded(by = ACTIVE)
public long countComponents(final Query query, @Nullable final Iterable<Repository> repositories) {
return countComponents(query.getWhere(), query.getParameters(), repositories, query.getQuerySuffix());
}
代码示例来源:origin: org.sonatype.nexus/nexus-repository
storageTx.begin();
Query.Builder query = Query.builder()
.where(GROUP).eq(group)
.and(NAME).eq(name)
代码示例来源:origin: org.sonatype.nexus/nexus-repository
@Override
@Guarded(by = ACTIVE)
public Iterable<Asset> findAssets(final Query query, @Nullable final Iterable<Repository> repositories) {
return findAssets(query.getWhere(), query.getParameters(), repositories, query.getQuerySuffix());
}
代码示例来源:origin: sonatype-nexus-community/nexus-repository-composer
@VisibleForTesting
protected Query buildQuery(final String vendor, final String project) {
return Query.builder().where(P_GROUP).eq(vendor).and(P_NAME).eq(project).build();
}
代码示例来源:origin: org.sonatype.nexus/nexus-repository
@Override
@Guarded(by = ACTIVE)
public Iterable<Component> findComponents(final Query query, @Nullable final Iterable<Repository> repositories) {
return findComponents(query.getWhere(), query.getParameters(), repositories, query.getQuerySuffix());
}
代码示例来源:origin: org.sonatype.nexus.plugins/nexus-repository-maven
/**
* Finds component in given repository by maven path.
*/
@Nullable
public static Component findComponent(final StorageTx tx,
final Repository repository,
final MavenPath mavenPath)
{
final Coordinates coordinates = mavenPath.getCoordinates();
final Iterable<Component> components = tx.findComponents(
Query.builder()
.where(P_GROUP).eq(coordinates.getGroupId())
.and(P_NAME).eq(coordinates.getArtifactId())
.and(P_VERSION).eq(coordinates.getVersion())
.build(),
singletonList(repository)
);
if (components.iterator().hasNext()) {
return components.iterator().next();
}
return null;
}
代码示例来源:origin: org.sonatype.nexus/nexus-repository
@Override
@Guarded(by = ACTIVE)
public Iterable<Asset> browseAssets(final Query query, final Bucket bucket) {
return assetEntityAdapter.browseByQueryAsync(db, query.getWhere(), query.getParameters(), ImmutableList.of(bucket),
query.getQuerySuffix());
}
代码示例来源:origin: org.sonatype.nexus.plugins/nexus-repository-npm
/**
* Builds query builder for {@link Component} based on passed in {@link NpmPackageId}.
*/
@Nonnull
private static Query.Builder query(final NpmPackageId packageId) {
if (packageId.scope() != null) {
return Query.builder().where(P_NAME).eq(packageId.name()).and(P_GROUP).eq(packageId.scope());
}
else {
return Query.builder().where(P_NAME).eq(packageId.name()).and(P_GROUP).isNull();
}
}
代码示例来源:origin: org.sonatype.nexus/nexus-repository
@Override
@Guarded(by = ACTIVE)
public long countAssets(final Query query, @Nullable final Iterable<Repository> repositories) {
return countAssets(query.getWhere(), query.getParameters(), repositories, query.getQuerySuffix());
}
代码示例来源:origin: org.sonatype.nexus.plugins/nexus-repository-maven
long totalComponents = tx.countComponents(Query.builder().build(), singletonList(repo));
log.info("Found {} total components in repository {} to evaluate for unused snapshots", totalComponents,
repo.getName());
代码示例来源:origin: org.sonatype.nexus.plugins/nexus-repository-maven
Query query = builder()
.where(P_GROUP).eq(groupId)
.and(P_NAME).eq(artifactId)
内容来源于网络,如有侵权,请联系作者删除!