Uploaded image for project: 'Spring Data Commons'
  1. Spring Data Commons
  2. DATACMNS-996

findByXOrderByX: Inconsistent processing of property names and Order specs

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.13 GA (Ingalls)
    • Fix Version/s: None
    • Component/s: Repositories
    • Labels:
      None

      Description

      Consider the following domain class:

      class Test {
        private x;
        ...
      }
      

      and the following findBy repository method:

      findByXOrderByX(...)
      

      When this method name is parsed and converted into a PartTree (and a Sort instance), the PartTree will refer to 'X' as 'x' - but the Sort will refer to the property as 'X'. Note that this inconsistency occurs only for property names that match the pattern [A-Z0-9._$]+ (see the implementation of PropertyPath.from()); for other property names there is no inconsistency.

      This inconsistency leads to problems during query creation in our spring-data implementation (because we are unable to get the persistent property path for capital 'X' on Test when processing the Sort). We have to work around this but it would be nice if it can be fixed on the spring-data level.

      We are using spring-data 1.13.0 but I suspect this issue is present in older versions as well.

        Attachments

          Activity

            People

            Assignee:
            olivergierke Oliver Drotbohm
            Reporter:
            vtoman Vojtech Toman
            Last updater:
            Vojtech Toman
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: