aspose file tools*
The moose likes Object Relational Mapping and the fly likes Hibernate: Can someone verify my mapping configuration? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Hibernate: Can someone verify my mapping configuration?" Watch "Hibernate: Can someone verify my mapping configuration?" New topic
Author

Hibernate: Can someone verify my mapping configuration?

Choon-Chern Lim
Ranch Hand

Joined: Aug 29, 2005
Posts: 74
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hibernate: Can someone verify my mapping configuration?