(Bug) Ensure clean up process also removes orphaned data in fragmenttable 72/142272/7
authoremaclee <lee.anjella.macabuhay@est.tech>
Tue, 14 Oct 2025 12:56:38 +0000 (13:56 +0100)
committeremaclee <lee.anjella.macabuhay@est.tech>
Wed, 15 Oct 2025 10:28:40 +0000 (11:28 +0100)
commit15e20fdf691556fd1c6a8d581dbd06716c02b06d
tree9fa096c8d082620033630cb614efeb59aac36f9a
parent48bd977e5dec6ba59af0b074a2af0e46161f3a5f
(Bug) Ensure clean up process also removes orphaned data in fragmenttable

- Add method to remove orphaned data from fragment table to the
  endpoint /cps/api/{}/admin/dataspaces/{}/actions/clean
- the condition for removing fragment table data is based on the following:
- (a) if entity's xpath contains more than 1 '/' and the parent is
  null
- (b) the parent id is equal to the id of an entity that
  meets condition (a)

Issue-ID: CPS-3006
Change-Id: I1a7de57993c58c3b607b3fdee7476a29bdea5bc2
Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech>
cps-rest/src/main/java/org/onap/cps/rest/controller/AdminRestController.java
cps-ri/src/main/java/org/onap/cps/ri/CpsAdminPersistenceServiceImpl.java
cps-ri/src/main/java/org/onap/cps/ri/repository/AnchorRepository.java
cps-ri/src/main/java/org/onap/cps/ri/repository/FragmentRepository.java
cps-service/src/main/java/org/onap/cps/api/CpsDataspaceService.java
cps-service/src/main/java/org/onap/cps/impl/CpsDataspaceServiceImpl.java
cps-service/src/main/java/org/onap/cps/spi/CpsAdminPersistenceService.java
cps-service/src/test/groovy/org/onap/cps/impl/CpsDataspaceServiceImplSpec.groovy
integration-test/src/test/groovy/org/onap/cps/integration/functional/cps/DataspaceServiceIntegrationSpec.groovy
integration-test/src/test/resources/data/bookstore/bookstore.yang