• 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
Propagate primary key questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Propagate primary key questions


  • Subject: Propagate primary key questions
  • From: James Cicenia <email@hidden>
  • Date: Sat, 21 Jul 2007 18:45:16 -0500

Hello -

I am adding a new table to the database and a new EO object that I want to be created automatically via owns destination and propagate key.

However, this is after the fact. Now, I guess I just don't understand but the following code to add the related record is giving me the following errors.

I must be tired, or blind, but I don't understand the problem.


EOEditingContext ec = session().defaultEditingContext();
EOFetchSpecification fetchPortfolio = new EOFetchSpecification();
fetchPortfolio.setEntityName("Portfolio");
NSArray fetchPortfolios = (ec.objectsWithFetchSpecification(fetchPortfolio)).immutableClone();
for(int i=0;i<fetchPortfolios.count();i++){
Portfolio portfolio = (Portfolio) fetchPortfolios.objectAtIndex(i);
PortfolioNotifications pn = (PortfolioNotifications)EOUtilities.createAndInsertInstance(ec, "PortfolioNotifications");
pn.setPortfolio(portfolio);
System.out.println("pn.portfolio.name is "+pn.portfolio().title());
portfolio.setNotifications(pn);
ec.saveChanges();
}

However, when it gets to saveChanges it tells me...


errorcom.webobjects.eoaccess.EOObjectNotAvailableException: No com.tos.eo.PortfolioNotifications found with globalID: _EOIntegralKeyGlobalID[PortfolioNotifications (java.lang.Integer)16]


That happens to be the row-id of the first portfolio...

What am I missing that is so obvious.

thanks
James Cicenia

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Propagate primary key questions
      • From: Chuck Hill <email@hidden>
    • Re: Propagate primary key questions
      • From: "John Bruce" <email@hidden>
  • Prev by Date: RE: inherited neglected site, what to do first?
  • Next by Date: Re: inherited neglected site, what to do first?
  • Previous by thread: RE: inherited neglected site, what to do first?
  • Next by thread: Re: Propagate primary key questions
  • Index(es):
    • Date
    • Thread