@Test public void whereWithAuth() throws Exception { String whereClause = underTest.buildWhereClause(emptyList(), queryOptions); assertThat(whereClause, is(equalTo(CONTENT_AUTH_WHERE))); }
@Override protected String buildWhereClause(final List<String> bucketIds, final QueryOptions queryOptions) { List<String> whereClauses = new ArrayList<>(); if (!bucketIds.isEmpty()) { whereClauses.add("(" + bucketIds.stream() .map((bucket) -> MetadataNodeEntityAdapter.P_BUCKET + " = " + bucket) .collect(Collectors.joining(" OR ")) + ")"); } if (queryOptions.getContentAuth()) { whereClauses.add("contentAuth(@this.name, @this.format, :browsedRepository) == true"); } return whereClause(Joiner.on(" AND ").join(whereClauses), queryOptions.getFilter() != null, queryOptions.getLastId() != null); }
BrowseAssetsSqlBuilder extends BrowseMetadataNodeSqlBuilderSupport { @Override protected String buildWhereClause(final List<String> bucketIds, final QueryOptions queryOptions) { List<String> whereClauses = new ArrayList<>(); if (!bucketIds.isEmpty()) { whereClauses.add("(" + bucketIds.stream() .map((bucket) -> MetadataNodeEntityAdapter.P_BUCKET + " = " + bucket) .collect(Collectors.joining(" OR ")) + ")"); } if (queryOptions.getContentAuth()) { whereClauses.add("contentAuth(@this.name, @this.format, :browsedRepository) == true"); } return whereClause(Joiner.on(" AND ").join(whereClauses), queryOptions.getFilter() != null, queryOptions.getLastId() != null); } }
BrowseAssetsSqlBuilder extends BrowseMetadataNodeSqlBuilderSupport { @Override protected String buildWhereClause(final List<String> bucketIds, final QueryOptions queryOptions) { List<String> whereClauses = new ArrayList<>(); if (!bucketIds.isEmpty()) { whereClauses.add("(" + bucketIds.stream() .map((bucket) -> MetadataNodeEntityAdapter.P_BUCKET + " = " + bucket) .collect(Collectors.joining(" OR ")) + ")"); } if (queryOptions.getContentAuth()) { whereClauses.add("contentAuth(@this.name, @this.format, :browsedRepository) == true"); } return whereClause(Joiner.on(" AND ").join(whereClauses), queryOptions.getFilter() != null, queryOptions.getLastId() != null); } @Inject  BrowseAssetsSqlBuilder(final AssetEntityAdapter assetEntityAdapter); }
BrowseAssetsSqlBuilder extends BrowseMetadataNodeSqlBuilderSupport { @Override protected String buildWhereClause(final List<String> bucketIds, final QueryOptions queryOptions) { List<String> whereClauses = new ArrayList<>(); if (!bucketIds.isEmpty()) { whereClauses.add("(" + bucketIds.stream() .map((bucket) -> MetadataNodeEntityAdapter.P_BUCKET + " = " + bucket) .collect(Collectors.joining(" OR ")) + ")"); } if (queryOptions.getContentAuth()) { whereClauses.add("contentAuth(@this.name, @this.format, :browsedRepository) == true"); } return whereClause(Joiner.on(" AND ").join(whereClauses), queryOptions.getFilter() != null, queryOptions.getLastId() != null); } @Inject  BrowseAssetsSqlBuilder(final AssetEntityAdapter assetEntityAdapter);  }
BrowseAssetsSqlBuilder extends BrowseMetadataNodeSqlBuilderSupport { @Override protected String buildWhereClause(final List<String> bucketIds, final QueryOptions queryOptions) { List<String> whereClauses = new ArrayList<>(); if (!bucketIds.isEmpty()) { whereClauses.add("(" + bucketIds.stream() .map((bucket) -> MetadataNodeEntityAdapter.P_BUCKET + " = " + bucket) .collect(Collectors.joining(" OR ")) + ")"); } if (queryOptions.getContentAuth()) { whereClauses.add("contentAuth(@this.name, @this.format, :browsedRepository) == true"); } return whereClause(Joiner.on(" AND ").join(whereClauses), queryOptions.getFilter() != null, queryOptions.getLastId() != null); } @Inject  BrowseAssetsSqlBuilder(final AssetEntityAdapter assetEntityAdapter);   }