• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Inheritance and hibernate mapping issue

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Hello,

I have an abstract class called AbstractActivity that doesn't map to any tables. I have two concrete classes AActivity and BActivity that map to two separate tables.

Here is the mapping of AActivity



I have a very similar mapping for BActivity. I want to keep these two entities separate in db.

Now here is the code for AActivity:




and here is the code for AbstractActivity




Now when i create an object from AActivity or BActivity and save it, there is no problem, everything is saved in db.

but I get an exception if i try to call any queries in AActivity's or BActivity's mapping file. Here is the exception:



Does "java.lang.InstantiationException: org.hibernate.impl.QueryImpl " mean that hibernate cannot understand the way my code is structured and hence cannot instantiate it?


I also tried



but no luck.

Any ideas?

thanks in advance
 
reply
    Bookmark Topic Watch Topic
  • New Topic