Escape SQL LIKE wildcards in queries (CPS-1760 #1) 33/135133/6
authordanielhanrahan <daniel.hanrahan@est.tech>
Fri, 23 Jun 2023 11:49:27 +0000 (12:49 +0100)
committerdanielhanrahan <daniel.hanrahan@est.tech>
Thu, 6 Jul 2023 16:28:00 +0000 (17:28 +0100)
commit531bd1002a480728936f8fa29ce87d4418783878
tree3fd51558f24bfdce9d131b48a291da4fb34f236c
parentddb8fce4f4300bb7cd1f477d846269d93f5036ae
Escape SQL LIKE wildcards in queries (CPS-1760 #1)

If '%' and '_' are used in the contains-condition of a CpsPath query,
incorrect results will be returned. For example:
  /bookstore/categories[contains(@code, "%")]
Special characters in the contains-condition value must be escaped.

Issue-ID: CPS-1762
Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech>
Change-Id: I2fdd5a26433d510cd7d6af5b734a6779b537d63d
cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentQueryBuilder.java
cps-ri/src/main/java/org/onap/cps/spi/repository/FragmentRepository.java
cps-ri/src/main/java/org/onap/cps/spi/utils/EscapeUtils.java [new file with mode: 0644]
cps-ri/src/test/groovy/org/onap/cps/spi/utils/EscapeUtilsSpec.groovy [new file with mode: 0644]
integration-test/src/test/groovy/org/onap/cps/integration/functional/CpsQueryServiceIntegrationSpec.groovy