• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problems mapping entities of single_table inheritance...

 
Volodymyr Lysenko
Ranch Hand
Posts: 512
1
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

I use hibernate 4. I use single_table inheriatnce strategy for entities JuniorUser extended by ExpertUser. It is mapped to Answer entity with type JuniorUser.

When I call this getter I have hibernate proxy of JuniorUser retrieved. I can cast this proxy to type JuniorUser but I can't cast it to ExpertUser. Therefore I can't access properties specific to ExpertUser! Trying to cast proxy to ExpertUser I received error ClassCastException.
How can I retrieve properties specific to ExpertUser having hibernate proxy Of JuniorUser?

Thank you!
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!