Revert "Migrate CPS to Spring-boot 3.0"
[cps.git] / cps-ri / src / main / java / org / onap / cps / spi / repository / FragmentRepository.java
index 1a31d2b..e38fc2f 100755 (executable)
@@ -124,15 +124,7 @@ public interface FragmentRepository extends JpaRepository<FragmentEntity, Long>,
         return findAllXpathByAnchorIdAndXpathIn(anchorEntity.getId(), xpaths.toArray(new String[0]));\r
     }\r
 \r
-    @Query(value = "SELECT EXISTS(SELECT 1 FROM fragment WHERE anchor_id = :anchorId"\r
-            + " AND xpath LIKE :xpathPattern LIMIT 1)", nativeQuery = true)\r
-    boolean existsByAnchorIdAndParentXpathAndXpathLike(@Param("anchorId") long anchorId,\r
-                                                       @Param("xpathPattern") String xpathPattern);\r
-\r
-    default boolean existsByAnchorAndXpathStartsWith(final AnchorEntity anchorEntity, final String xpath) {\r
-        return existsByAnchorIdAndParentXpathAndXpathLike(anchorEntity.getId(),\r
-                EscapeUtils.escapeForSqlLike(xpath) + "%");\r
-    }\r
+    boolean existsByAnchorAndXpathStartsWith(AnchorEntity anchorEntity, String xpath);\r
 \r
     @Query(value = "SELECT * FROM fragment WHERE anchor_id = :anchorId AND parent_id IS NULL", nativeQuery = true)\r
     List<FragmentEntity> findRootsByAnchorId(@Param("anchorId") long anchorId);\r