-->
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: executing query and transient values
PostPosted: Thu Jan 18, 2007 4:25 pm 
Newbie

Joined: Fri Jan 05, 2007 6:44 am
Posts: 12
Hello

I am getting the following exception thrown in a validator when I query the db for the existence of an entity A.

Code:
Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: B
   at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
   at org.hibernate.event.def.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:284)


The validator basically searches for the entity A by unique string code to ensure it doesnt exist.

If I do not set object B on A before calling the validator, the validator *doesn't* throw the error and the object is persisted correctly.

A hbm Mapping
Code:
<set
      name="B"
      cascade="all-delete-orphan">
      <key column="ID" />
      <one-to-many class="B" />
/>
</set>


How can I run validators like this without getting this transient exception?
Is this a problem in our design?
Any thoughts appreciated?

regards
JC


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.