-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: insert a bean with relationship problem!!!
PostPosted: Thu Mar 16, 2006 8:02 am 
Newbie

Joined: Thu Mar 16, 2006 7:22 am
Posts: 1
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.