I have read Hibernate in Action and tried looking on this forum, however, I am still confused with how to map a code table ..........
I have a client table and associated class.
That table has a foreign key to a code (lookup) table.
For example :
Code:
CREATE TABLE cl_client
(c_client char(10) NOT NULL NOT DEFAULT
, c_group char(10) WITH NULL
etc
Foreign Key Constraint :
Code:
ALTER TABLE cl_client ADD CONSTRAINT cl_client_fk_1
FOREIGN KEY (c_group) REFERENCES cl_group
Code (Lookup Table) :
Code:
CREATE TABLE cl_group
(c_group char(10) NOT NULL NOT DEFAULT
, t_group char(30) NOT NULL NOT DEFAULT
, f_obsolete (char 1) NOT NULL NOT DEFAULT
I want to modify the ClClient class so that when it does a read or a list, it does a left join from the cl_client table to cl_group table and gets the text t_group for the specified c_group.
The cl_group table also has a life of its own (entries can be created, deleted, and updated etc) .....
What is the best way to map the association between the c_group column/field in the cl_client table and the cl_group table.
Thanks for your help,
Mike