I have table which has the below definition,
CREATE TABLE REPORTER.TRESERVE_FACTOR
(
MEASURE_ID NUMBER NOT NULL,
YEAR_NO NUMBER NOT NULL,
QUARTER_NO NUMBER(1,0) NOT NULL,
POOL_CD CHAR(8) NOT NULL,
COMPANY_NO CHAR(4) NOT NULL,
ANNUAL_STMT_LN_ID CHAR(3) NOT NULL,
CRNT_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN1_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN2_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN3_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
MIN4_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL,
UPDATE_TS DATE NOT NULL,
UPD_USER_ID CHAR(8) NOT NULL,
MIN5_RESRV_FCTR_PC NUMBER(13,6) DEFAULT 0 NOT NULL
)
PRIMARY KEY (MEASURE_ID,YEAR_NO,QUARTER_NO,POOL_CD,COMPANY_NO,ANNUAL_STMT_LN_ID)
I have created the entity class for the table TRESERVE_FACTOR using Netbeans. It created two POJOS,
TreserveFactor -- POJO for Table it has TreserveFactorPK as one of the type
TreserveFactorPK --- POJO class for Primarykeys of TRESERVE_FACTOR table
Now, I have problem in referring the primay keys in the mapping document.
Say, for example, I have a set created for this table.
Then, I can't define the property for primary key columns.
For, non primary key columns, I can define the proerty as follows,
<set name="treserveFactors" table="TRESERVE_FACTOR">
.
.
.
<property name ="crntResrvFctrPc" column="CRNT_RESRV_FCTR_PC"/>
</set>
But, for primary key columns I could not do it.
<set name="treserveFactors" table="TRESERVE_FACTOR">
<property name ="measureId" column="CRNT_RESRV_FCTR_PC"/>
.
.
</set>
If I define it like above, it is not working. I have tried other options like,
<property name ="treserveFactorPK " column="CRNT_RESRV_FCTR_PC"/>
Please advise.
Here, the property measureId is in TreserveFactorPK POJO Class..