javax.persistence.PersistenceException

org.hibernate.WrongClassException: Object [id=1] was not of the specified subclass [bug.ChildTwo] : loaded object was of wrong class class bug.ChildOne

Samebug tips1

Check your annotations to use the proper table and column names.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web66

  • Stack trace

    • javax.persistence.PersistenceException: org.hibernate.WrongClassException: Object [id=1] was not of the specified subclass [bug.ChildTwo] : loaded object was of wrong class class bug.ChildOne at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692) at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602) at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    thiago.santosthiago.santos
    2 times, last one
    mauritiusmauritius
    6 times, last one
    TahirTahir
    2 times, last one
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitorOnce,
    13 more bugmates