• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Duplicate record
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Duplicate record


  • Subject: Re: Duplicate record
  • From: Hunter Hillegas <email@hidden>
  • Date: Tue, 20 Jul 2004 16:33:30 -0700

You are doing something like this?

MyEO newEO = new MyEO();
editingContext.insertObject(newEO);

newEO = oldEO;

editingContext.saveChanges()?

I don't think you can just set the objects equal like that. You would want to call all of the getters and setters for the properties, i.e.:

newEO.setMyProperty(oldEO.myProperty());

Does that help?

On Jul 20, 2004, at 3:57 PM, A. Uchida wrote:

No, The diamond was checked off and the primary key field is invisible from the application.
Should I manually nullify the primary key in the application with the diamond checked in the EOModel?
I didn't try it yet, because it doesn't look proper way for me.


I found my email was a bit blurred.
When modifying a record, I want to make the duplication with new primary key.
So I inserted a new object and set the modifying record to the new object to allow to be edited
and then do saveChanges(). The primary key of the original records are also set to
the new object but I was expecting the primary key will be set as new automatically when saveChanges().


Or there may be another method to do this? (Sorry I don't know the way to find a proper method in the API
documents)




On 20 Jul 2004, at 23:41, Hunter Hillegas wrote:

Is your primary key a class property (is the little diamond checked in EOModeler)?

This can cause EOF to try to update a primary key, which causes exception fever.

On Jul 20, 2004, at 3:03 PM, A. Uchida wrote:

Hi there,

WO 5.2
Mac OS X10.3.4
Postgresql7.3.4 (pg73jdbc.jar)

When modifying an existing record in a table I want to keep the existing record as it is,
because it might be used (relationed) to the other records in the other table.
What I've tried was :
Show details of a record which is going to be modified
Insert new object into the table
Copy the details of record to the inserted object
and saveChanges()


But it gets primary key duplication error.
And I tried search on web/mailing list but I couldn't find any clue.
I even doesn't know what would be the keyword for search this issue.

Any help would be very much appreciated.

A. Uchida
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Duplicate record
      • From: "A. Uchida" <email@hidden>
References: 
 >Duplicate record (From: "A. Uchida" <email@hidden>)
 >Re: Duplicate record (From: Hunter Hillegas <email@hidden>)
 >Re: Duplicate record (From: "A. Uchida" <email@hidden>)

  • Prev by Date: supplying an initial selection in WOPopUpButton and its kin
  • Next by Date: Re: Question on editing contexts
  • Previous by thread: Re: Duplicate record
  • Next by thread: Re: Duplicate record
  • Index(es):
    • Date
    • Thread