Hello everybody
I am using the version 3.1.2 of hibernate and using MS SQL Server 2000. this project was working on oracle. recently we have replaced it with the hibernate. but I have faced the following problem:
I have 2 tables
+ TBL_Request
- ID (PK, numeric)
- REQ_TIMESTAMP (timestamp)
- CURRENCY_ISO_CODE (numeric)
+ TBL_CURRENCY
- ID (PK, numeric)
- ISO_CODE (numeric)
- ABB (varchar)
and 2 java persistent beans
+ CurrencyBean
- id (int)
- isoCode (int)
- abbreviation (String)
+ RequestBean
- id (PK, numeric)
- currency (CurrencyBean)
- requestTimestamp (Calendar)
the mapping file of the RequestBean has refered to the CurrencyBean using many-to-one relationship as the following:
<many-to-one name="currency" property-ref = "isoCode" column = "CURRENCY_ISO_CODE" insert="true" update="true"/>
when I am trying to insert a new request bean all the request fields are filled except the CURRENCY_ISO_CODE column it is filled with NULL value.
can any body explain why hibernate setted this column as null. and how to set the actual value.
_________________ SCJA 1.0, SCJP 1.4, SCWCD 1.4, SCBCD 1.3
Haitham R. Ismail
|