From 3d97a963ce51c4f0ecdb656a3b25bcabf2f6f8b7 Mon Sep 17 00:00:00 2001 From: "raviteja.karumuri" Date: Tue, 25 Apr 2023 19:41:29 +0100 Subject: [CPS] RI, Service: Code Refactoring # Remove unused method "updateDataNodeAndDescendants" # Remove unused production code Issue-ID: CPS-1594 Signed-off-by: raviteja.karumuri Change-Id: Id909e9da3e9181c181dfdfe62f051451d8e488a2 --- .../onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java | 15 --------------- .../org/onap/cps/spi/repository/FragmentRepository.java | 7 ------- 2 files changed, 22 deletions(-) (limited to 'cps-ri/src/main') diff --git a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java index 369e5289b1..3d9105f680 100644 --- a/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/impl/CpsDataPersistenceServiceImpl.java @@ -493,21 +493,6 @@ public class CpsDataPersistenceServiceImpl implements CpsDataPersistenceService fragmentRepository.save(fragmentEntity); } - @Override - public void updateDataNodeAndDescendants(final String dataspaceName, final String anchorName, - final DataNode dataNode) { - final AnchorEntity anchorEntity = getAnchorEntity(dataspaceName, anchorName); - final FragmentEntity fragmentEntity = getFragmentEntity(anchorEntity, dataNode.getXpath()); - updateFragmentEntityAndDescendantsWithDataNode(fragmentEntity, dataNode); - try { - fragmentRepository.save(fragmentEntity); - } catch (final StaleStateException staleStateException) { - throw new ConcurrencyException("Concurrent Transactions", - String.format("dataspace :'%s', Anchor : '%s' and xpath: '%s' is updated by another transaction.", - dataspaceName, anchorName, dataNode.getXpath())); - } - } - @Override public void updateDataNodesAndDescendants(final String dataspaceName, final String anchorName, final Collection updatedDataNodes) { diff --git a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java index d25832ba54..8114f1055a 100755 --- a/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java +++ b/cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java @@ -90,13 +90,6 @@ public interface FragmentRepository extends JpaRepository, List findByAnchorAndParentXpath(@Param("anchor") AnchorEntity anchorEntity, @Param("parentXpath") String parentXpath); - @Query(value = "SELECT id, anchor_id AS anchorId, xpath, parent_id AS parentId," - + " CAST(attributes AS TEXT) AS attributes" - + " FROM FRAGMENT WHERE " - + "( xpath = :parentXpath OR xpath LIKE CONCAT(:parentXpath,'/%') )", - nativeQuery = true) - List findByParentXpath(@Param("parentXpath") String parentXpath); - @Query(value = "SELECT id, anchor_id AS anchorId, xpath, parent_id AS parentId," + " CAST(attributes AS TEXT) AS attributes" + " FROM FRAGMENT WHERE anchor_id = :anchorId" -- cgit 1.2.3-korg