|
Hibernate version: 3.0
Hello All,
I think this should be a very simple problem, but I seem to be having some difficulty finding the right solution. Let's say I have two database tables: TABLE and TABLE_TYPE (i.e a dining room table, etc.)
TABLE has a few attributes: ID, NAME, TABLE_TYPE_ID (FK), etc.
TABLE_TYPE has three attributes: TABLE_TYPE_ID (PK) , NAME (dining room table, kitchen table, end table, coffee table, etc.) , DESCRIPTION
Now, to simplify my class structure, I only want a 'Table' class where one of the attributes is 'tableTypeName', which I would read via the PK/FK relationship between TABLE and TABLE_TYPE (TABLE has only one TABLE_TYPE). This is where my problem lies. I can't quite figure out which mapping element to use in my .hbm file.
Can anyone please help me out here?? Thanks!
|