hi,
I have a lookup table with the following structure:
CREATE TABLE payroll_title (
payroll_title_id int(11) NOT NULL auto_increment,
code varchar(4) NOT NULL,
name varchar(30) NOT NULL,
PRIMARY KEY (payroll_title_id)
);
and a corresponding mapping file:
<hibernate-mapping>
<class name="edu.ucsd.som.PayrollTitle" table="payroll_title">
<id name="id" column="payroll_title_id" type="long">
<generator class="native"/>
</id>
<property name="name" column="name" not-null="true" type="string" />
<property name="code" column="code" not-null="true" length="4" unique="true" type="string" />
</class>
</hibernate-mapping>
other tables should link to the payroll title table using the code field, not the primary payroll_title_id key. Is such setup possible?
|