• 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

creating a database from a data model

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to annotate my classes using Hibernate. Suppose you have a UML diagram were you have a Person as a superclass, and a Member who is a child class of Person. Then you have Member who can be composed of many EmergencyContacts:


EmergencyContact *----1<> Member ----> Person

The Member will have an attribute of type List<EmergencyContact>. The EmergencyContact will have a foreign key called Member_Id that points to an Id in Member. I'm going to annotate the inheritance relationship between Person with @MappedSuperclass and Person with @Entity. How would you annotate EmergencyContact? Is there a best way to design a database with a composite relationship like this, or is the choice debatable? Should I create another table by labeling EmergencyContact with @Entity?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic