Results 1 to 2 of 2

Thread: generics in JPA namedQueries problem in spring data jpa

Hybrid View

  1. #1
    Join Date
    May 2011
    Posts
    14

    Default generics in JPA namedQueries problem in spring data jpa

    I have a pretty tricky problem and I think it is related to Spring Data Jpa, I am using 1.0.0.M2.
    the named queries work fine if I used generics like this: List<A> methodABCD();
    but if I want to use List<A<B>> it stops to work. The error I got is the following.
    (does anybody use Generics like this?) .. Thanks in advance.

    Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.Parameteriz edTypeImpl cannot be cast to java.lang.Class
    at org.springframework.data.repository.util.ClassUtil s.getReturnedDomainClass(ClassUtils.java:63)
    at org.springframework.data.repository.query.QueryMet hod.getDomainClass(QueryMethod.java:107)
    at org.springframework.data.jpa.repository.query.JpaQ ueryMethod.getNamedQueryName(JpaQueryMethod.java:1 26)
    at org.springframework.data.jpa.repository.query.Name dQuery.lookupFrom(NamedQuery.java:71)

  2. #2
    Join Date
    May 2011
    Posts
    14

    Default

    Ok, this is actually fixed in the spring data jpa snapshot. -cy

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •