Re: Simple Web forms to create an EO object
Re: Simple Web forms to create an EO object
- Subject: Re: Simple Web forms to create an EO object
- From: Amorya North <email@hidden>
- Date: Thu, 5 Aug 2004 00:28:33 +0100
Yeah, that's what I heard before.
Has anyone looked at the "iShacks" example (in the JavaWebObjects
folder in the examples folder)? Am I mistaken about what they're doing?
It seemed to me that they were setting values (when making a new user)
before inserting the EO...
Amorya
On 5 Aug 2004, at 12:22 am, Dirk Bajohr wrote:
Amorya,
EOs may behave strange if you insert them into an EditingContext after
setting some values (especially if you set relationships to other
EOs). It's always best to insert them first. Don't set any values in
the constructor (before inserting).
But inserting into a context doesn't mean the object is in the
database. It will be written only if you call saveChanges, which is
the last step.
Cheers,
Dirk
Just been looking through Apple's examples... in one, they create an
EO
object as the page is created, but don't insert it into any editing
context! They do the insertion when the Save button is pressed. (At
least, I think that's what happens from reading the code).
I thought this was a bad idea. Someone told me once in no uncertain
terms that you should never have an Enterprise Object that wasn't in
the database.
Any thoughts?
--
Dirk Bajohr
iSOLUTION - Individuelle Software fuer moderne Kommunikation
Hauptstr. 50
53757 Sankt Augustin
T +49 2241 921567-0
F +49 2241 921567-89
http://www.isolution.de
_______________________________________________
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.