Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting up Hibernate Discriminators

 
Mike London
Ranch Hand
Posts: 1290
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I understand it, if I have constraints set up in my database, Hibernate will pretty much reverse-engineer everything I need (POJOs). Really Nice.

However, if I have polymorphic relationships (subclasses, etc.), then does the reverse engineering for POJO subclasses still work as long as I set up the database to have the "discriminator" columns?

What I'm asking is if I have a case where I need to use discriminators for polymorphic relationships, do I then need to manually edit/create the HBM mapping files or will Hibernate still reverse engineer everything for me (POJOs for subclasses, for example) as long as I set up the database to have the correct strategy (table per subclass, for example)?

Thanks in advance.

Mike
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!