-->
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.  [ 2 posts ] 
Author Message
 Post subject: Composite Primary Key problem..........
PostPosted: Mon Mar 20, 2006 8:44 am 
Newbie

Joined: Wed Feb 22, 2006 2:29 am
Posts: 5
I have a table having composite primary key, which is formed using 5 columns.

Now when I try to update this table, I am unable to do so.
Can anyone plz help........

After setting the new values for the table, I used
session.saveOrUpdate(table);
tx.commit();
n then session.flush();

I get the following Exception

Exception in thread "main" org.hibernate.PropertyValueException: not-null property references a null or transient value: com.neatxs.hibernate.exchangeinstmap.Exchangeinstrumentmap.exinstname
at org.hibernate.engine.Nullability.checkNullability(Nullability.java:72)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:164)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:190)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:70)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:26)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:730)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:324)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:86)
at UpdateClient.saveEIMToDatabase(UpdateClient.java:124)
at UpdateClient.main(UpdateClient.java:58)

_________________
- 5thElement


Top
 Profile  
 
 Post subject: Re: Composite Primary Key problem..........
PostPosted: Mon Mar 20, 2006 11:36 am 
Expert
Expert

Joined: Fri Aug 19, 2005 2:11 pm
Posts: 628
Location: Cincinnati
5thElement wrote:
Exception in thread "main" org.hibernate.PropertyValueException: not-null property references a null or transient value: com.neatxs.hibernate.exchangeinstmap.Exchangeinstrumentmap.exinstname


could be either of the following.

-you are trying to update an object where one of the key attributes was db generated and you haven't gotten that value yet

-one of your key values is null, or another one which is set to not allow null values

-you are trying to modify the pk values, which doesn't work. in this case you should just delete and make a new row

_________________
Chris

If you were at work doing this voluntarily, imagine what you'd want to see to answer a question.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.