Standard JCR-SQL2 only allows `CAST( ``value`` AS ``type`` )` on the right-hand side of a constraint. This is limiting, especially when the property value may contain a value that is convertible to another type and the constraint should be applied using that other type.
For example, consider a node type with a property definition for `propertyY` that defines the type as a STRING. Even if some of those values contained string-representations of DOUBLE values, the following query could not be performed:
It would be nice to be able to do this:
Doing this will require having a `DynamicOperand` subtype for the `CAST` operation, though the value in the cast probably only needs to be a `PropertyValue`. Specifically, something like this:
where `PropertyValue` and `PropertyType` are already defined in the grammar.