• 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

Hibernate: Can someone verify my mapping configuration?

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm still experimenting with Hibernate, and I would really appreciate if someone could provide me some feedbacks on my mapping configuration.

My test app has 3 database tables: PERSON, CAR and CARTYPE. The relationship between PERSON and CAR is one-to-many, and CARTYPE to CAR is one-to-many.

These are my JAVA bean classes:-


These are my database tables:-




Basically, a person can have many cars. The CARTYPE table is more like a dictionary where it has a list of available car names, like Mustang, Ford, Honda, etc. So, CARTYPE is totally independent from other tables.


This is my mapping configuration:-
=========================================


May I know if my mapping configuration above is set up correctly? I saw a Hibernate example (Order, LineItem, Product) which is very similar to what I have here, but it pretty much consolidates the CAR mapping into PERSON using COMPOSITE-ELEMENT tag and I wasn't quite sure what's going on there.

Thanks much in advance!
 
You know it is dark times when the trees riot. I think this tiny ad is their leader:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic