-->
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.  [ 3 posts ] 
Author Message
 Post subject: not-null property references a null or transient value
PostPosted: Mon Feb 06, 2006 2:35 pm 
Newbie

Joined: Mon Feb 06, 2006 9:26 am
Posts: 2
Hi,
I have many-to-one relationship between "Formulae" and the "Model" they belong to. I need to saveOrUpdate() them all in one transaction. I got PropertyValueException while trying to save Formulae (after Model was first saved into the session, but not committed). The Formulae reference in that case into an unsaved transient instance. If I first commit Model to persistent-state, no exceptions are thrown. Is it possible to save them all in one session?

Im using Hibernate3 on Oracle 8.

Exception in thread "main":org.hibernate.PropertyValueException: not-null property references a null or transient value

Thanks
-J


Top
 Profile  
 
 Post subject: not-null="true"
PostPosted: Mon Feb 06, 2006 4:10 pm 
Beginner
Beginner

Joined: Fri Jul 22, 2005 3:35 pm
Posts: 24
Location: Buenos Aires, Argentina
Be sure to put not-null="true" wherever applicable (e.g. the many-to-one relationship). Hibernate uses this value to calculate the order of SQL statements.


Top
 Profile  
 
 Post subject: Re: not-null="true"
PostPosted: Tue Feb 07, 2006 3:53 am 
Newbie

Joined: Mon Feb 06, 2006 9:26 am
Posts: 2
niqueco wrote:
Be sure to put not-null="true" wherever applicable (e.g. the many-to-one relationship). Hibernate uses this value to calculate the order of SQL statements.


Thanks for your quick answer,
I had not-null="true" in Formula's many-to-one reference!

<class name="Formula" table="FORMULA" schema="TEST">
<id name="uniqueid" type="java.math.BigDecimal">
<column name="UNIQUEID" scale="0" />
<generator class="assigned" />
</id>
<many-to-one name="Model" class="Model" fetch="select">
<column name="MODEL" scale="0" not-null="true" />
</many-to-one>


Any other ideas?
-J


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

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.