Skip to content

Commit

Permalink
Merge branch 'feature/434618_datasets_count' into 'develop'
Browse files Browse the repository at this point in the history
feature/434618_datasets_count

See merge request upm-inesdata/inesdata-connector!23
  • Loading branch information
ralconada-gmv committed Jun 19, 2024
2 parents 31bf6d2 + 74cf770 commit 007ba89
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public long countElements(@QueryParam("type") String entityType) {
if (!Objects.equals(entityType, "asset") && !Objects.equals(entityType, "policyDefinition")
&& !Objects.equals(entityType, "contractDefinition")
&& !Objects.equals(entityType, "contractAgreement")
&& !Objects.equals(entityType, "transferProcess")) {
&& !Objects.equals(entityType, "transferProcess")
&& !Objects.equals(entityType, "federatedCatalog")) {
throw new BadRequestException("Entity type provided is not valid");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ public String getCount(String entityType) {
case "transferProcess":
tableName = getTransferProcessTable();
break;
case "federatedCatalog":
tableName = getDatasetTable();
break;
}
return format("SELECT COUNT(*) FROM %s",
tableName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,19 @@ default String getContractDefinitionTable() {
}

/**
* The vocabulary table name.
* The transfer process table name.
*/
default String getTransferProcessTable() {
return "edc_transfer_process";
}

/**
* The dataset table name.
*/
default String getDatasetTable() {
return "edc_dataset";
}

/**
* SELECT COUNT clause.
*/
Expand Down

0 comments on commit 007ba89

Please sign in to comment.