Details

    • Type: Feature Request
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 4.0.0.Alpha2
    • Fix Version/s: 4.5.0.Final
    • Component/s: Query
    • Labels:
      None

      Description

      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:

      SELECT * FROM [nodex] as x  where x.propertyY <= 20.50
      

      It would be nice to be able to do this:

      SELECT * FROM [nodex] as x  where CAST(x.propertyY AS DOUBLE) <= 20.50
      

      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:

      DynamicOperand ::= PropertyValue | ReferenceValue |
                         Length | NodeName | NodeLocalName |
                         NodePath | NodeDepth |
                         CastPropertyValue |
                         FullTextSearchScore |
                         LowerCase | UpperCase |
                         Arithmetic |
                         '(' DynamicOperand ')'
      
      CastPropertyValue ::= 'CAST(' PropertyValue ' AS ' PropertyType ')'
      

      where `PropertyValue` and `PropertyType` are already defined in the grammar.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  hchiorean Horia Chiorean
                  Reporter:
                  rhauch Randall Hauch
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: