Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Mix of hibernate inheritance strategies

 
Ranch Hand
Posts: 123
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
  Hello!

  I have 2 entities:

 



  And data from B successfully persists in table A. So, one table for 2 entities - A and B.
 

  I created third entity - C.
 

  I want data from C to persisted in separate table - C.  
  So, finally -  one table A for A/B entities,  and one more table for C.
  In this case 2 strategies are mixed: SINGLE_TABLE  and  TABLE_PER_CLASS

  For this purpose i applied to B annotation @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)

 

 But without success - data from C persisted in single table A.   So SINGLE_TABLE  is working only

 

 
Creator of Enthuware JWS+ V6
Posts: 3349
303
Android Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't mix different stategies in the same class hierarchy.
 
So there I was, trapped in the jungle. And at the last minute, I was saved by this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic