• 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: compound primary key ("failed to provide new primary keys")
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compound primary key ("failed to provide new primary keys")


  • Subject: Re: compound primary key ("failed to provide new primary keys")
  • From: Chuck Hill <email@hidden>
  • Date: Sat, 14 Jun 2008 23:22:36 -0700


On Jun 14, 2008, at 10:32 PM, Gavin Eadie wrote:

Lucky I love learning!  Things I learned:

... in WebObjects, if it's difficult, you're doing it wrongly!

Amen. "if it takes more than three lines, you are probably doing it wrong"



... Chuck is always right (even if he doesn't mention flattening in his book).

After much internal debate we decided to only mention the merely obvious and eliminate the blindingly obvious. :-P



... Apple's documentation for EOF at WO version 4.5 rocks!

Sadly, this true. The 4.5 docs + updates for Eclipse would be great. Alas, I think this task is now up to the community. There was a lot of discussion at WOWODC and WWDC on how we might best do this. I heard a lot of good ideas. I expect there will be some discussion of them in the near future once everyone recovers from seven straight days of conferencing.




... Start with the model and let the database take care of itself.

Yep, focus on what you want to get done, not on how you thing you might need to do it.



WebObjects standard flattened many-to-many relationship was what I was missing. I was focused on the legacy tables I was working with and they were muddying the waters. My new code is now working perfectly, is smaller than before, easier to read and I'm happy again. Thanks to those who helped, thanks to those who didn't wonder out loud how I ever got this far without comprehending some of the simpler aspects of EOF ... Gav


Rest assured, there is always one more quirk waiting to be discovered.


Chuck


On Jun 14, 2008, at 7:08 PM, Chuck Hill wrote:

Why do they even have a class? If it is just two keys, just use an EOGenericRecord and flatten the relationships. Then all you need to do is to say user().addToFavoriteAdverts(ad); I don't think you should even need the addObjectToBothSidesOfRelationshipWithKey. That might cause too much faulting for popular ads.

The real world model is a bulletin board of advertisements whose users may select some favorite ads that they want to keep track of. So a boring ad will have no connecting Select, and someone who is not a frequent visitor may have no connecting Select. On the other hand a really interesting ad may have dozens of Selects (dozens of people putting it in their favorites), and a busy user may have dozens Selects (ads they are tracking). Any one Select contains only the pkeys of the Advert and Author (user) it relates. This may have been modeled badly seven years ago, but it's what I have to work with !! Gav

Seems to me like it should be no trouble at all.

Chuck

_______________________________________________ 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


--

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems.
http://www.global-village.net/products/practical_webobjects






_______________________________________________
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


References: 
 >compound primary key ("failed to provide new primary keys") (From: Gavin Eadie <email@hidden>)
 >Re: compound primary key ("failed to provide new primary keys") (From: Johann Werner <email@hidden>)
 >Re: compound primary key ("failed to provide new primary keys") (From: Gavin Eadie <email@hidden>)
 >Re: compound primary key ("failed to provide new primary keys") (From: Chuck Hill <email@hidden>)
 >Re: compound primary key ("failed to provide new primary keys") (From: Gavin Eadie <email@hidden>)

  • Prev by Date: Re: compound primary key ("failed to provide new primary keys")
  • Next by Date: Re: WOLips BUG: can't configure frameworks set used in application
  • Previous by thread: Re: compound primary key ("failed to provide new primary keys")
  • Next by thread: WOLips BUG: can't configure frameworks set used in application
  • Index(es):
    • Date
    • Thread