\r
package org.onap.cps.spi.repository;\r
\r
+import java.util.Collection;\r
+import javax.validation.constraints.NotNull;\r
+import org.onap.cps.spi.entities.AnchorEntity;\r
import org.onap.cps.spi.entities.FragmentEntity;\r
import org.springframework.data.jpa.repository.JpaRepository;\r
+import org.springframework.data.jpa.repository.Modifying;\r
+import org.springframework.data.jpa.repository.Query;\r
+import org.springframework.data.repository.query.Param;\r
import org.springframework.stereotype.Repository;\r
\r
@Repository\r
public interface FragmentRepository extends JpaRepository<FragmentEntity, Long> {\r
\r
+ @Modifying\r
+ @Query("DELETE FROM FragmentEntity fe WHERE fe.anchor IN (:anchors)")\r
+ void deleteByAnchorIn(@NotNull @Param("anchors") Collection<AnchorEntity> anchorEntities);\r
+\r
}
\ No newline at end of file