-->
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: Update + composite-id
PostPosted: Mon Jun 14, 2004 1:57 pm 
Newbie

Joined: Mon Jun 14, 2004 1:51 pm
Posts: 5
Hi,

I will like to know how to update value of a composite ID.

Here is an exemple of my code:

<composite-id name="etudiantSommairePeriodePK" class="EtudiantSommairePeriodePK"
unsaved-value="any">
<key-property
name="typeDossier"
column="TYPE_DOSSIER"
type="java.lang.String"
length="2"
/>
<key-property
name="dateDebutExemption"
column="DATE_DEBUT_EXEMPTION"
type="java.util.Date"
/>
<key-property
name="noSeqEtudiant"
type="java.lang.Integer"
column="NO_SEQ_ETUDIANT"
length="9"
/>
</composite-id>

I create a class for my composite ID EtudiantSommairePK but each time i try to modify one of this three values I have the following error:

13:57:04,659 ERROR DbHibernate:200 - net.sf.hibernate.UnresolvableObjectException: No row with the given identifier exists: com.macrocontact.app.model.db.persistence.EtudiantSommairePeriodePK@244e2739, of class: com.macrocontact.app.model.db.persistence.EtudiantSommairePeriode

can someone help me

Thx

Lud


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 2:02 pm 
Newbie

Joined: Wed Jun 02, 2004 7:06 pm
Posts: 8
Just a side comment, not what you are looking for, but from a database perspective in general one should not modify the primary key of an existing record.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 14, 2004 6:22 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
It is true for Hibernate too

_________________
Emmanuel


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.