Announcement Announcement Module
Collapse
No announcement yet.
generics in JPA namedQueries problem in spring data jpa Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Ok, this is actually fixed in the spring data jpa snapshot. -cy

    Comment

    Working...
    X