Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » [Teneo] Is it possible to modify the value of an EAttribute that is a PK?
[Teneo] Is it possible to modify the value of an EAttribute that is a PK? [message #73528] Sun, 04 March 2007 07:08 Go to next message
Eclipse UserFriend
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 Go to previous message
Martin Taal is currently offline Martin TaalFriend
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 Go to previous message
Martin Taal is currently offline Martin TaalFriend
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
Previous Topic:[Elver/Teneo] Hibernate Search (Apache Lucene) integration
Next Topic:OneToMany and index tables
Goto Forum:
  


Current Time: Fri Apr 26 05:17:01 GMT 2024

Powered by FUDForum. Page generated in 0.03540 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top