-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Many to one mapping
PostPosted: Fri Feb 02, 2007 5:57 am 
Newbie

Joined: Tue Jan 30, 2007 8:44 am
Posts: 6
Hi,

I have used Hibernate tools to reverse engineer my mapping files and POJO classes from an existing db which has gone well and all is working well.
Hibernate tools has created many to one mappings for foreign keys in my mapping xml and POJO classes.
The foreign key tables I have created contain only at most 4 entries which relate to a description to an Integer key in the main tables, e.g. main_table-
status=1 is a foreign key to status_table-status_id=1, description=loaded,
My question is when persisting entries into the main_table I seem to have to create a type of status_table set its status_id to 1 then set this as the value
of main_table's status.

This works fine but I'm just wondering if I am going about this the correct way, or if this is the best method when only a few fixed values exist in the status_table?

TIA,
Mike.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.