aspose file tools*
The moose likes Object Relational Mapping and the fly likes Problems mapping entities of single_table inheritance... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Problems mapping entities of single_table inheritance..." Watch "Problems mapping entities of single_table inheritance..." New topic
Author

Problems mapping entities of single_table inheritance...

Volodymyr Levytskyi
Ranch Hand

Joined: Mar 29, 2012
Posts: 505
    
    1

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!


True person is moral, false is right!
 
jQuery in Action, 2nd edition
 
subject: Problems mapping entities of single_table inheritance...