org.sonatype.nexus.repository.storage.Query.builder()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(3.4k)|赞(0)|评价(0)|浏览(190)

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

Query.builder介绍

[英]Helper for creating query builder.
[中]帮助创建查询生成器。

代码示例

代码示例来源: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

storageTx.begin();
Query.Builder query = Query.builder()
  .where(GROUP).eq(group)
  .and(NAME).eq(name)

代码示例来源: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.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.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.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)

相关文章