Re: Setting a Default toOne Relationship
Re: Setting a Default toOne Relationship
- Subject: Re: Setting a Default toOne Relationship
- From: Chuck Hill <email@hidden>
- Date: Fri, 19 May 2006 08:11:16 -0700
On May 19, 2006, at 3:02 AM, David Avendasora wrote:
Hi Ken,
The objects must get inserted upon instantiation. What would the
point be of having a context that you don't use until you save the
information to the database? Might just as well do direct JDBC
calls then.
Well, you might be unpleasantly surprised. Many of the Apple
tutorials show some very bad examples of EOF usage. I am pretty sure
that D2W uses the "don't insert until save" paradigm in the add
entity pages. D2W is pretty near impossible to use well unless you
are using the Wonder extensions/patches. I would not be surprised
to learn that D2JC also suffers from this bit of nasty design. Try
saving the object and see if awakeFromInsertion gets called.
This seems to suggest that this is not what is happening but an
experiment would confirm / deny this:
According to the WebObjects Java Client Programming Guide (http://
developer.apple.com/documentation/WebObjects/DesktopApplications/
WODesktopApps.pdf), Chapter 6, the section on specifying initial
values (page 123) if you add setters in the awakeFromInsertion()
method, these values will show up immediately.
...
Build and run the application and create a new student record.
You’ll notice that some of the fields are populated in the new
record as shown in Figure 6-11.
Have you tried this example? Does it work?
Chuck
On May 19, 2006, at 10:48 AM, Ken Anderson wrote:
David,
I would guess that the object won't actually get inserted into the
context on the server side until you try to save. I could be
wrong, since I've never done Java client work before, but that's
what I would suspect. Can you confirm or deny this?
I suggest doing some experiments saving the object to see when
awakeFromInsertion() gets called on the server side...
Ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40global-village.net
This email sent to email@hidden
--
Coming in 2006 - an introduction to web applications using WebObjects
and Xcode http://www.global-village.net/wointro
Practical WebObjects - for developers who want to increase their
overall knowledge of WebObjects or who are trying to solve specific
problems. http://www.global-village.net/products/practical_webobjects
_______________________________________________
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