@Test public void testFormatBoolean() throws Exception { assertEquals("'"+Boolean.TRUE.toString()+"'", QueryUtil.format(valueFactory.createValue(true))); }
@NotNull public static String format(@NotNull Value value) throws RepositoryException { switch (value.getType()) { case PropertyType.STRING: case PropertyType.BOOLEAN: return '\'' + QueryUtil.escapeForQuery(value.getString()) + '\''; case PropertyType.LONG: case PropertyType.DOUBLE: return value.getString(); case PropertyType.DATE: return "xs:dateTime('" + value.getString() + "')"; default: throw new RepositoryException("Property of type " + PropertyType.nameFromValue(value.getType()) + " not supported"); } }
QueryUtil { @NotNull public static String format(@NotNull Value value) throws RepositoryException { switch (value.getType()) { case PropertyType.STRING: case PropertyType.BOOLEAN: return '\'' + QueryUtil.escapeForQuery(value.getString()) + '\''; case PropertyType.LONG: case PropertyType.DOUBLE: return value.getString(); case PropertyType.DATE: return "xs:dateTime('" + value.getString() + "')"; default: throw new RepositoryException("Property of type " + PropertyType.nameFromValue(value.getType()) + " not supported"); } } }
QueryUtil { @NotNull public static String format(@NotNull Value value) throws RepositoryException { switch (value.getType()) { case PropertyType.STRING: case PropertyType.BOOLEAN: return '\'' + QueryUtil.escapeForQuery(value.getString()) + '\''; case PropertyType.LONG: case PropertyType.DOUBLE: return value.getString(); case PropertyType.DATE: return "xs:dateTime('" + value.getString() + "')"; default: throw new RepositoryException("Property of type " + PropertyType.nameFromValue(value.getType()) + " not supported"); } } private  QueryUtil(); }
QueryUtil { @NotNull public static String format(@NotNull Value value) throws RepositoryException { switch (value.getType()) { case PropertyType.STRING: case PropertyType.BOOLEAN: return '\'' + QueryUtil.escapeForQuery(value.getString()) + '\''; case PropertyType.LONG: case PropertyType.DOUBLE: return value.getString(); case PropertyType.DATE: return "xs:dateTime('" + value.getString() + "')"; default: throw new RepositoryException("Property of type " + PropertyType.nameFromValue(value.getType()) + " not supported"); } } 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); }
QueryUtil { @NotNull public static String format(@NotNull Value value) throws RepositoryException { switch (value.getType()) { case PropertyType.STRING: case PropertyType.BOOLEAN: return '\'' + QueryUtil.escapeForQuery(value.getString()) + '\''; case PropertyType.LONG: case PropertyType.DOUBLE: return value.getString(); case PropertyType.DATE: return "xs:dateTime('" + value.getString() + "')"; default: throw new RepositoryException("Property of type " + PropertyType.nameFromValue(value.getType()) + " not supported"); } } 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);  }