WrongClassException « Map « JPA Q&A





1. Hibernate: org.hibernate.WrongClassException, SINGLE_TABLE inheritance and DiscriminatorFormula    stackoverflow.com

I'm using Hibernate 3.2.2 GA with HSQLDB 2.0 GA, and I have a class hierarchy similar to the following:

@Entity
@Table(name = "A_TABLE")
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@DiscriminatorFormula(value = "case when CODE IN (1, 2, 3, ...

2. Hierarchy mapping WrongClassException    forum.hibernate.org

@Entity public abstract class ClassB{ (...) protected ClassA myA; @ManyToOne() @Foreign(name="B_A") public ClassA getMyA(){...} (...) } @Entity public class SubB1{ (...) @Transient public SubA1 getMyA(){ ...

3. ManyToMany and Table per Hierarchy WrongClassException    forum.hibernate.org

Hi, I'm trying to implement a table per hierarchy and I'm getting Code: org.hibernate.WrongClassException: Object with id: 162 was not of the specified subclass: nl.project.model.Category (Discriminator: EVT) at org.hibernate.loader.Loader.getInstanceClass(Loader.java:1600) at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1431) at org.hibernate.loader.Loader.getRow(Loader.java:1355) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611) at org.hibernate.loader.Loader.doQuery(Loader.java:829) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274) at org.hibernate.loader.Loader.loadCollection(Loader.java:2166) ...

4. Inheritance Problem / WrongClassException    forum.hibernate.org

Newbie Joined: Fri May 27, 2005 12:58 pm Posts: 2 Hi, I'm having some troubles with mapping/querying connected to inheritance. I have an abstract superclass HCP and two classes extending it: the Doctor and the Insitution class. I mapped them in one file called HCP.hbm.xml with the subclass-tag, using the one-table-per-class-hierarchry-strategy as suggested in the documentation. Inserting new objects of type ...

5. WrongClassException using simple table inheritance strategy    forum.hibernate.org

Author Message mk195787 Post subject: WrongClassException using simple table inheritance strategy Posted: Sat Jan 10, 2009 8:41 am Newbie Joined: Sat Jan 10, 2009 8:06 am Posts: 6 Location: Poland Hi, Firstly I want to thank all hibernate developers. This framework is huge masterpiece. During development of my app I found a strange behaviour. I tried to get rid ...