[Teneo] Is it possible to modify the value of an EAttribute that is a PK? [message #73528] |
Sun, 04 March 2007 07:08 |
Eclipse User |
|
|
|
Originally posted by: eclipsenews.cs-guy.com
I have an EClass with an EAttribute marked as an ID attribute. It has come
up that I need to change the value of the ID attribute of an already
persisted instance. However, it seems that after the code changes the value
and saves the resource, the value of the ID on that instance has not changed
in the DB, even though other edits made to the same object were correctly
updated.
Does Teneo disallow chaning the PK of an object once it is saved? Should
it? I am wondering whether I might be doing something wrong, or this
behavior is by design, or I should submit a bug. I am currently using Teneo
v0.7.5.v200701041633.
Chris
|
|
|
Re: [Teneo] Is it possible to modify the value of an EAttribute that is a PK? [message #73634 is a reply to message #73528] |
Mon, 05 March 2007 17:00 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Chris,
Apparently Hibernate does not allow changing the pk (new for me to):
http://forum.hibernate.org/viewtopic.php?t=965186&highli ght=update+primary+key
For jpox I am not sure but I would think that they do not support changing the pk either (they did
not a few years ago).
I am not sure if you can for your case but at Hibernate they advice to always use a generated id
(like a sequence number). Overall generated (numeric) id's are easier to handle. With as main
disadvantage that import/export of data is more complex.
It all depends on your case ofcourse.
gr. Martin
Chris Hines wrote:
> I have an EClass with an EAttribute marked as an ID attribute. It has come
> up that I need to change the value of the ID attribute of an already
> persisted instance. However, it seems that after the code changes the value
> and saves the resource, the value of the ID on that instance has not changed
> in the DB, even though other edits made to the same object were correctly
> updated.
>
> Does Teneo disallow chaning the PK of an object once it is saved? Should
> it? I am wondering whether I might be doing something wrong, or this
> behavior is by design, or I should submit a bug. I am currently using Teneo
> v0.7.5.v200701041633.
>
> Chris
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Re: [Teneo] Is it possible to modify the value of an EAttribute that is a PK? [message #603111 is a reply to message #73528] |
Mon, 05 March 2007 17:00 |
Martin Taal Messages: 5468 Registered: July 2009 |
Senior Member |
|
|
Chris,
Apparently Hibernate does not allow changing the pk (new for me to):
http://forum.hibernate.org/viewtopic.php?t=965186&highli ght=update+primary+key
For jpox I am not sure but I would think that they do not support changing the pk either (they did
not a few years ago).
I am not sure if you can for your case but at Hibernate they advice to always use a generated id
(like a sequence number). Overall generated (numeric) id's are easier to handle. With as main
disadvantage that import/export of data is more complex.
It all depends on your case ofcourse.
gr. Martin
Chris Hines wrote:
> I have an EClass with an EAttribute marked as an ID attribute. It has come
> up that I need to change the value of the ID attribute of an already
> persisted instance. However, it seems that after the code changes the value
> and saves the resource, the value of the ID on that instance has not changed
> in the DB, even though other edits made to the same object were correctly
> updated.
>
> Does Teneo disallow chaning the PK of an object once it is saved? Should
> it? I am wondering whether I might be doing something wrong, or this
> behavior is by design, or I should submit a bug. I am currently using Teneo
> v0.7.5.v200701041633.
>
> Chris
>
>
--
With Regards, Martin Taal
Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Tel: +31 (0)84 420 2397
Fax: +31 (0)84 225 9307
Mail: mtaal@springsite.com - mtaal@elver.org
Web: www.springsite.com - www.elver.org
|
|
|
Powered by
FUDForum. Page generated in 0.03191 seconds