• 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: Dealing with objects not yet in a context (or shouldn't I ?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dealing with objects not yet in a context (or shouldn't I ?)


  • Subject: Re: Dealing with objects not yet in a context (or shouldn't I ?)
  • From: Ricardo Strausz <email@hidden>
  • Date: Sun, 27 Aug 2006 09:54:03 -0500

Hola Yann!

On Aug 27, 2006, at 9:32 AM, email@hidden wrote:

Message: 3

Date: Sun, 27 Aug 2006 12:52:44 +0200

From: Yann Bizeul <email@hidden>

Subject: Dealing with objects not yet in a context (or shouldn't I ?)

To: WebObjects-Dev Apple <email@hidden>

Message-ID: <email@hidden">email@hidden>

Content-Type: text/plain; charset=WINDOWS-1252; delsp=yes;

format=flowed



NEVER use an Object out of an EditingContext!!
You can use instead
com.webobjects.eoaccess.EOUtilities 
createAndInsertInstance(EOEditingContext ec, String entityName)

Dino

Hi list,


Here is the scenario :


User <-->> LocationTagUser <<--> Location


Basically, Users does have different Locations for which they assign  

their tags (keywords, or whatever). I would be pleased to have a  

flattened relationship between Usres en Location, but since I have an  

additional attribute in the linking table, I can't, that's ok.


Now, a user does want to add a location, but before adding a  

duplicate one, we check the database to see if it (the Location) does  

not exists yet, and ask the user to choose among existing ones.


But I did the choice to not insert my temporary Location object the  

user is adding until I'm sure it is not a duplicate one, insted of  

adding it in the session's default context, and remove everything in  

case he choose an existing one (and remove Locations and associated  

LocationTagUsers) to replace with the existing object relationships.  

But that causes problems with Location's methods involving  

EOFetchSpecification.


Is this a wrong approach ? should a temporary object be part of the  

editing context as soon as it is born ?


What is the best way to manage such "temporary" objects with their  

relation to make the code as simple as possible ?


Thank you


Yann Bizeul • yann at tynsoe.org

Cocoa Developer


Tynsoe Projects

BuddyPop • GeekTool • SSH Tunnel Manager • ...

http://projects.tynsoe.org/



 _______________________________________________
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

  • Prev by Date: Dealing with child's editing contexts [explained] :-)
  • Next by Date: Is WebObjects 4.5 going open source?
  • Previous by thread: Re: Dealing with objects not yet in a context (or shouldn't I ?)
  • Next by thread: EOModeler problem
  • Index(es):
    • Date
    • Thread