• 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

Using abstract class in Set?

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

I have the following classes:





Too, I have a class like this:




I'm mapping the classes A, B and MyClasses using the union-subclass strategy, as I'd like all variables in A and B to be replicated to the MyClasses. Also, I don't want A and B to have a table of their own, so they are marked with . The mapping works like a charm, the tables created are exactly as I want them to be.

I map the MySetClass as following:



The problem arises when I'm trying to persist the Set in MySetClass:



yields the following exception:

Invalid object name 'A'.


I assume the exception arises because Hibernate looks for a table named 'A', but it doesn't exist because it's abstract (and therefore marked with abstract="true" in the mapping file).

What am I doing wrong here? I cannot be that Hibernate cannot figure out what to do in the example above? It's just trivial inheritance.


Regards,

Janus
 
reply
    Bookmark Topic Watch Topic
  • New Topic