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.
|