Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems mapping entities of single_table inheritance...

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

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!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic