diff options
Diffstat (limited to 'components/datalake-handler/feeder/src')
2 files changed, 14 insertions, 1 deletions
diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java index 058d4ca9..fc709360 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/controller/DbController.java @@ -258,6 +258,15 @@ public class DbController { } + //get db type list + @GetMapping("/dbtypes") + @ResponseBody + @ApiOperation(value="Get a list of all db types.") + public Iterable<DbType> getDbTypes(HttpServletResponse response) throws IOException { + log.info("Get a list of all db types ......"); + Iterable<DbType> dbTypes = dbTypeRepository.findAll(); + return dbTypes; + } @PostMapping("/verify") @ResponseBody diff --git a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/DbType.java b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/DbType.java index 9c83a9cd..700ce8cb 100644 --- a/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/DbType.java +++ b/components/datalake-handler/feeder/src/main/java/org/onap/datalake/feeder/domain/DbType.java @@ -29,6 +29,9 @@ import javax.persistence.FetchType; import javax.persistence.Id; import javax.persistence.OneToMany; import javax.persistence.Table; + +import com.fasterxml.jackson.annotation.JsonBackReference; + import lombok.Getter; import lombok.Setter; @@ -56,7 +59,8 @@ public class DbType { @Column(name="`tool`", nullable = false) private boolean tool; - + + @JsonBackReference @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dbType") protected Set<Db> dbs = new HashSet<>(); |