2 Replies Latest reply on May 30, 2006 11:53 PM by Emmanuel Bernard

    querying with persited enums throws class cast exception

    Brian Newbie

      Hi all,

      I used to have a query that worked before I upgraded to 4.0.4.GA. It used to be ejb3 rc3. Anyway, lets say I have entity bean A, which has a private variable B where B is a persisted enum. Now I used to query in a session bean something like


      Query q = entityManager.createQuery("select * from A a where B:=b");
      q.setParameter("b", b.ordinal);

      However now I'm getting a ClassCastExeption on this parameter to do with Integer. I'm using mysql and I've checked that persisted enums are still stored as integers which they are. Has anyone got any ideas what I can do?

      thanks very much,
      Brian