• 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
A relationship to a static Entity that is not saved to the db (or part of the EOModel)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A relationship to a static Entity that is not saved to the db (or part of the EOModel)


  • Subject: A relationship to a static Entity that is not saved to the db (or part of the EOModel)
  • From: Stefan Foulis <email@hidden>
  • Date: Tue, 06 Jul 2004 01:54:00 +0200

I have the following scenario:
There is an EO Entity built in EOModeler, lets call the Class "A" and its instances "Ax". Every Ax can be in one of 5 different states. These states ("S", "Sx") have some additional member variables, like a String holding the name of the state. These member variables never change and are known at development time.


So instead of saving these states ("Sx") as usual EnterpriseObjects in the database and defining them as read-only I'd like to create them in the sourcecode, never creating a table for them in the database. One of their member variables would be an Integer, the primary key.

Every "Ax" has an Integer aswell, the foreign key. It is saved in the database along with other data.

Now there should be a method in "A" called state(); that returns the corresponding state object instance "Sx" and setState(State newState); that sets its foreign key according to the state object given as parameter.

"S" should have a method that returns all "Ax"'s that are in that state.

Has anyone got an idea how this can be accomplished (without making the foreign key in "A" directly visible) ?

I hope I was able to describe this scenatio in an understandable fashion... but feel free to ask any questions if the problem isn't clear.
Thanks for any help.
stefan
_______________________________________________
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: A relationship to a static Entity that is not saved to the db (or part of the EOModel)
      • From: Jean-François Veillette <email@hidden>
  • Prev by Date: Re: A "Why WebObjects" Site / Initial Thoughts Please (Modified by Bob McCormick)
  • Next by Date: Re: A "Why WebObjects" Site / Initial Thoughts Please
  • Previous by thread: Re: where to store connection pool singleton
  • Next by thread: Re: A relationship to a static Entity that is not saved to the db (or part of the EOModel)
  • Index(es):
    • Date
    • Thread