• 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
Enforcing a maximum cardinality on a many-to-many relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Enforcing a maximum cardinality on a many-to-many relationship


  • Subject: Enforcing a maximum cardinality on a many-to-many relationship
  • From: Paul Hoadley <email@hidden>
  • Date: Tue, 15 Aug 2017 11:41:33 +0930

Hello,

I have EOs Job and Worker. Job.workers is a many-to-many relationship to
Worker, set up in the usual way, so there’s a JobWorker join table.
Job.maxWorkers is a mandatory Integer attribute whose value will be 1 or
greater.

I need to enforce a business rule such that Job.workers.count can never exceed
Job.maxWorkers. It’s sufficient that this is enforced at save-time: if a
particular in-memory Job has addToWorkersRelationship() called on it too many
times, I’m not too bothered, but it can’t be saved that way. Further, it needs
to be robust in the presence of multiple EOF stacks. (And although we use
JGroups synchronisation in deployment, assume that we don’t. The sync may not
happen fast enough.)

To me this sounds like a problem for database triggers: reject an insert on
JobWorker that would cause Job.workers.count to exceed Job.maxWorkers for the
referenced Job. Before I launch into that, though, does anyone know of (or can
anyone think of) a robust EOF-only solution to this problem?


--
Paul Hoadley
https://logicsquad.net/
https://www.linkedin.com/company/logic-squad/




 _______________________________________________
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: Enforcing a maximum cardinality on a many-to-many relationship
      • From: Chuck Hill <email@hidden>
  • Prev by Date: Re: WOOgnl, redux
  • Next by Date: Re: Enforcing a maximum cardinality on a many-to-many relationship
  • Previous by thread: Re: WOOgnl, redux
  • Next by thread: Re: Enforcing a maximum cardinality on a many-to-many relationship
  • Index(es):
    • Date
    • Thread