aspose file tools
The moose likes Object Relational Mapping and the fly likes Simple mapping issue for Hibernate newbie Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "Simple mapping issue for Hibernate newbie" Watch "Simple mapping issue for Hibernate newbie" New topic
Author

Simple mapping issue for Hibernate newbie

Tom Collins
Greenhorn

Joined: Mar 13, 2006
Posts: 10
I have a one-to-many relationship (at least I think) between a product and production state table. A product can be in only one of the pre-defined states of production at a time (e.g. "in production", "inspection", etc.) The product table has a foreign key called production_state_id. Because the production state table only has a primary key and a description, it really doesn't merit an object in Java.

I currently have a product object which contains a string indicating its state of production. My question: how do I map this relationship? This is probably a ridiculously simple problem, but for all the reading up I've done, I can't find an answer for this situation. The following is my mapping file for the product (Note: I used product throughout the post as a generic term for the industry specific product "die" - i.e. tool & die).



Me fail english?! That's unpossible!
Rashid Darvesh
Ranch Hand

Joined: Feb 13, 2004
Posts: 189
Check out this
http://www.makemyinfo.com/Tutorial.do?action=getTutorial&tutId=T0005.jsp
 
IntelliJ Java IDE
 
subject: Simple mapping issue for Hibernate newbie
 
Threads others viewed
Hibernate- one-to-many association on a foreign key
Hibernate : Index in parent table
Hibernate - multiple collection with restrictions mapping problem
mapping question (hashmap and subclasses)
polymormsim related demos
developer file tools