Uploaded image for project: 'Spring Data JPA'
  1. Spring Data JPA
  2. DATAJPA-965

Mapping Sort instances to ORDER BY expressions should be restricted to fields for manually defined queries

    Details

    • Sprint:
      Hopper SR3 / Gosling SR5

      Issue Links

        Activity

        olivergierke Oliver Gierke created issue -
        olivergierke Oliver Gierke made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.9.5 (Gosling SR5) [ 15495 ]
        Fix Version/s 1.10.3 (Hopper SR3) [ 15582 ]
        Fix Version/s 1.11 RC1 (Ingalls) [ 15700 ]
        Resolution Fixed [ 1 ]
        olivergierke Oliver Gierke made changes -
        Assignee Oliver Gierke [ olivergierke ] Christoph Strobl [ cstrobl ]
        olivergierke Oliver Gierke made changes -
        Fix Version/s 1.8.3 (Fowler SR3) [ 15270 ]
        olivergierke Oliver Gierke made changes -
        Fix Version/s 1.8.3 (Fowler SR3) [ 15270 ]
        olivergierke Oliver Gierke made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Hide
        zyro zyro added a comment -

        somehow it seems the fix of this issue (or rather one of the added regex expressions) broke java 6 compatibility (using oracle jdk1.6.0_45)?

        Caused By: java.util.regex.PatternSyntaxException: Look-behind group does not have an obvious maximum length near index 58
        \s+\w+\([0-9a-zA-z\._,\s']+\)\s+[as|AS]+\s+(?<alias>[\w\.]+)
                                                                  ^
                at java.util.regex.Pattern.error(Pattern.java:1713)
                at java.util.regex.Pattern.group0(Pattern.java:2488)
                at java.util.regex.Pattern.sequence(Pattern.java:1806)
                at java.util.regex.Pattern.expr(Pattern.java:1752)
                at java.util.regex.Pattern.compile(Pattern.java:1460)
                at java.util.regex.Pattern.<init>(Pattern.java:1133)
                at java.util.regex.Pattern.compile(Pattern.java:823)
                at org.springframework.data.jpa.repository.query.QueryUtils.<clinit>(QueryUtils.java:164)
                at org.springframework.data.jpa.repository.query.JpaQueryMethod.assertParameterNamesInAnnotatedQuery(JpaQueryMethod.java:102)
                at org.springframework.data.jpa.repository.query.JpaQueryMethod.<init>(JpaQueryMethod.java:95)
                at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:77)
                at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:435)
                at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:220)
                at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:266)
                at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:252)
                at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:92)
        

        ref. https://github.com/spring-projects/spring-data-jpa/blame/1.10.3.RELEASE/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java#L162

        Show
        zyro zyro added a comment - somehow it seems the fix of this issue (or rather one of the added regex expressions) broke java 6 compatibility (using oracle jdk1.6.0_45)? Caused By: java.util.regex.PatternSyntaxException: Look-behind group does not have an obvious maximum length near index 58 \s+\w+\([0-9a-zA-z\._,\s']+\)\s+[as|AS]+\s+(?<alias>[\w\.]+) ^ at java.util.regex.Pattern.error(Pattern.java:1713) at java.util.regex.Pattern.group0(Pattern.java:2488) at java.util.regex.Pattern.sequence(Pattern.java:1806) at java.util.regex.Pattern.expr(Pattern.java:1752) at java.util.regex.Pattern.compile(Pattern.java:1460) at java.util.regex.Pattern.<init>(Pattern.java:1133) at java.util.regex.Pattern.compile(Pattern.java:823) at org.springframework.data.jpa.repository.query.QueryUtils.<clinit>(QueryUtils.java:164) at org.springframework.data.jpa.repository.query.JpaQueryMethod.assertParameterNamesInAnnotatedQuery(JpaQueryMethod.java:102) at org.springframework.data.jpa.repository.query.JpaQueryMethod.<init>(JpaQueryMethod.java:95) at org.springframework.data.jpa.repository.query.JpaQueryLookupStrategy$AbstractQueryLookupStrategy.resolveQuery(JpaQueryLookupStrategy.java:77) at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.<init>(RepositoryFactorySupport.java:435) at org.springframework.data.repository.core.support.RepositoryFactorySupport.getRepository(RepositoryFactorySupport.java:220) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.initAndReturn(RepositoryFactoryBeanSupport.java:266) at org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport.afterPropertiesSet(RepositoryFactoryBeanSupport.java:252) at org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean.afterPropertiesSet(JpaRepositoryFactoryBean.java:92) ref. https://github.com/spring-projects/spring-data-jpa/blame/1.10.3.RELEASE/src/main/java/org/springframework/data/jpa/repository/query/QueryUtils.java#L162
        Hide
        olivergierke Oliver Gierke added a comment -

        Would you mind creating a new issue and (optionally) add a sample project that reproduces the exception?

        Show
        olivergierke Oliver Gierke added a comment - Would you mind creating a new issue and (optionally) add a sample project that reproduces the exception?
        Hide
        olivergierke Oliver Gierke added a comment -

        I just successfully ran Hopper SR3 on a JDK 6 (Mac, Update 65) and it seems to work okay. If you open the new ticket I can attach the sample project for you to test on other platforms.

        Show
        olivergierke Oliver Gierke added a comment - I just successfully ran Hopper SR3 on a JDK 6 (Mac, Update 65) and it seems to work okay. If you open the new ticket I can attach the sample project for you to test on other platforms.
        Hide
        zyro zyro added a comment -
        Show
        zyro zyro added a comment - continued in https://jira.spring.io/browse/DATAJPA-970
        olivergierke Oliver Gierke made changes -
        Link This issue is related to DATAJPA-970 [ DATAJPA-970 ]
        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Resolved Resolved
        14m 10s 1 Oliver Gierke 20/Sep/16 8:40 AM
        Resolved Resolved Closed Closed
        8h 57m 1 Oliver Gierke 20/Sep/16 5:37 PM

          People

          • Assignee:
            cstrobl Christoph Strobl
            Reporter:
            olivergierke Oliver Gierke
            Last updater:
            Oliver Gierke
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Agile