QueryUtil { @NotNull public static String escapeForQuery(@NotNull String oakName, @NotNull NamePathMapper namePathMapper) { return escapeForQuery(namePathMapper.getJcrName(oakName)); } private  QueryUtil(); @NotNull static String getSearchRoot(AuthorizableType type, ConfigurationParameters config); @NotNull static String getNodeTypeName(@NotNull AuthorizableType type); @NotNull static String escapeNodeName(@NotNull String string); @NotNull static String format(@NotNull Value value); @NotNull static String escapeForQuery(@NotNull String oakName, @NotNull NamePathMapper namePathMapper); @NotNull static String escapeForQuery(@NotNull String value); @NotNull static RelationOp getCollation(@NotNull QueryBuilder.Direction direction); @Nullable static String getID(@Nullable Authorizable authorizable);  }
@Test public void testEscapeForQuery() { NamePathMapper namePathMapper = new NamePathMapperImpl(new LocalNameMapper( ImmutableMap.of(NamespaceRegistry.PREFIX_JCR, NamespaceRegistry.NAMESPACE_JCR), ImmutableMap.of("myPrefix", NamespaceRegistry.NAMESPACE_JCR))); String value = "'string\\value"; assertEquals(QueryUtils.escapeForQuery("myPrefix:"+value), QueryUtil.escapeForQuery("jcr:"+value, namePathMapper)); }