• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

WrongClassException in Inheritance Mapping

 
Shaan Shar
Ranch Hand
Posts: 1249
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I am trying to map an inheritance relationship, but i am getting an error.
This is my mapping file:


This is the method where the exception is thrown:



and the exception:



Can someone help me? i am stuck at this.

Thanks in advance for early responses
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My only guess is that it is related to your use of generics.

<?> I would think you would want something line <? super Category> or is it <? extends Category> My brain isn't quite working at this very moment.

Mark
 
Diego Garcia
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Mark,

I originally wrote that post in the hibernate forums, and that guy "Ankur Sharma" has copied it (please, Ankur Sharma, post your own questions).

this is the link to my post in the Hibernate forums:
http://forum.hibernate.org/viewtopic.php?t=987425

Thanks for the help

P.S. Edited to add the link
[ June 04, 2008: Message edited by: Diego Garcia ]
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Diego Garcia, please check your private messages.
[ June 04, 2008: Message edited by: Paul Sturrock ]
 
Jelle Klap
Bartender
Posts: 1952
7
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I recall nearly driving myself insane trying to figure out where this WrongClassException kept coming from. Just as I was about ready to axe-murder some bunnies, I took a final look at the hibernate.cfg.xml file and noticed that i had failed to include the particular entity's mapping file.
Which made no sense to me, because I expected an entirely different exception, but that was the reality of it nonetheless. So, double checking your mapping definitions in hibernate.cfg.xml might be worth it - please, think of the bunnies.
 
Diego Garcia
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help, Jelle, but no luck for me. I have included the entity's mapping file...any other idea? anyone?

Thanks in advance
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankur Sharma, please check your private messages.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic