• 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

When to Use @DiscriminatorColumn Annotation?

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a class named Attribute which basically has a uid, and type. (S, M, L for sizes, Square or Circle for shapes, etc.)
It is derived by a class named AttributeColor which also has an integer indicating the color.
Mapping them, I have a table called attributes and a table called attributes_colors. The inheritance is a 'Table Per Class' and annotated with @Inheritance(strategy = JOINED).
My question is if I have to use the @DiscriminatorColumn annotation? If so, this will of course require me to alter the tables themselves.
If I understand correctly, JOINED strategy doesn't require this annotation, but can make better performance.
So, when to use this annotation? How can it improve performance?

Guy
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic