• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

WrongClassException in Inheritance Mapping

 
Ranch Hand
Posts: 1249
Spring Java 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
 
ranger
Posts: 17346
11
Mac IntelliJ IDE 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
 
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 ]
 
Bartender
Posts: 10336
Hibernate Eclipse IDE 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 ]
 
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
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ankur Sharma, please check your private messages.
 
I'm THIS CLOSE to ruling the world! Right after reading this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic