Re: Creating an EOEditingContext object
Re: Creating an EOEditingContext object
- Subject: Re: Creating an EOEditingContext object
- From: Chuck Hill <email@hidden>
- Date: Sun, 25 Apr 2004 19:22:09 -0700
I don't know where the heck you've been "gathering" that from!
Dude. Dude. It's WebObjects. Its easy to do things like this. The hands
down simplest way is to use
session().defaultEditingContext(). That will only work in the context of
Session, DirectAction, and WOComponent subclasses. If you need one
someplace else:
EOEditingContext ec = new EOEditingContext();
ec.lock();
try {
// your code goes here
}
finally {
ec.unlock();
}
Chuck
P.S. Your model would be best placed in a framework for ease of reuse.
At 07:11 PM 25/04/2004 -0700, Ismael Nass-Duce wrote:
>Hi,
>
>How can I create an EOEditingContext object that I can use to
>access records from a database.
>
>I created a WebObjects application, which uses the same EO model
>that I used for WebObjects Java Client.
>
>I want to use the objectsWithFetchSpecification() or
>EOUtilities.objectsForEntityNamed()
>methods to fetch objects from the database.
>
> From what I can gather, I'll need to do the following:
>
> >| - construct a model from a file
> >| - create a EODatabase from that model
> >| - create an EOQualifier with format
> >| - create an EOFetchSpecification with entity
> >| - retrieve an EOEditingContext from EODatabase
>
>Is there sample code that applies these steps?
>
>Ismael
>_______________________________________________
>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.
>
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
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.