Announcement Announcement Module
Collapse
No announcement yet.
Spring Data JPA bug? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Data JPA bug?

    Hi,

    Has anyone encountered this?
    Running a query method that accepts a Pageable twice throws an exception.
    In org.springframework.data.jpa.repository.UserReposi toryFinderTests

    Code:
        @Test
        public void executesPagingMethodToListCorrectly() {
    
            List<User> list =
                    userRepository.findByFirstname("Carter", new PageRequest(0, 1));
    // Error when method called the second time 
            List<User> list2 =
                    userRepository.findByFirstname("Carter", new PageRequest(0, 1));
            assertThat(list.size(), is(1));
        }
    Exception:-
    Code:
    java.util.NoSuchElementException
    	at java.util.AbstractList$Itr.next(AbstractList.java:350)
    	at org.springframework.data.jpa.repository.query.JpaQueryCreator$ParameterExpressionProvider.next(JpaQueryCreator.java:314)
    	at org.springframework.data.jpa.repository.query.JpaQueryCreator.toPredicate(JpaQueryCreator.java:213)
    	at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:103)
    	at org.springframework.data.jpa.repository.query.JpaQueryCreator.create(JpaQueryCreator.java:50)
    	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createCriteria(AbstractQueryCreator.java:107)
    	at org.springframework.data.repository.query.parser.AbstractQueryCreator.createQuery(AbstractQueryCreator.java:86)
    	at org.springframework.data.jpa.repository.query.PartTreeJpaQuery$QueryPreparer.createQuery(PartTreeJpaQuery.java:145)
    	at org.springframework.data.jpa.repository.query.PartTreeJpaQuery.createQuery(PartTreeJpaQuery.java:78)
    	at org.springframework.data.jpa.repository.query.JpaQueryExecution$CollectionExecution.doExecute(JpaQueryExecution.java:81)
    	at org.springframework.data.jpa.repository.query.JpaQueryExecution.execute(JpaQueryExecution.java:55)
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.doExecute(AbstractJpaQuery.java:100)
    	at org.springframework.data.jpa.repository.query.AbstractJpaQuery.execute(AbstractJpaQuery.java:89)
    	at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:343)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    	at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:155)
    	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    	at $Proxy42.findByFirstname(Unknown Source)
    	at org.springframework.data.jpa.repository.UserRepositoryFinderTests.executesPagingMethodToListCorrectly(UserRepositoryFinderTests.java:132)

  • #2
    Yeah, me too. I have the same problem.

    Comment


    • #3
      indeed, reverted towards 1.0.0.M5

      Comment


      • #4
        I've posted a JIRA regarding this issue: https://jira.springsource.org/browse/DATAJPA-90

        Comment


        • #5
          Fixed and deployed to snapshot repository.

          Comment

          Working...
          X