D2W EditToOne relationship question
D2W EditToOne relationship question
- Subject: D2W EditToOne relationship question
- From: Aaron Rosenzweig <email@hidden>
- Date: Mon, 7 Mar 2005 23:41:50 -0500
Hello Everyone,
=== Problem Description: ===
I want to connect two tables with a Mandatory and Owned To-One
relationship where I propagate the primary key of the main table to the
subordinate table. That's a mouthful! More concretely, I have a
"Merchandise" table which contains information about price, shipping,
title, summary, etc. I want to have a "Thumbnail" image of a particular
merchandise but I don't want it stored as a column of the "Merchandise"
table. I don't always need to show the Thumbnail in my application so I
want to load that image "on demand" only when it is needed. This saves
memory and traffic to the database. So… I set up "Merchandise" and
"Thumbnail" in EOModeler like this:
"Merchandise":
1) Mandatory
2) Owns Destination
3) Propagate Primary Key
4) Cascades on delete
"Thumbnail":
1) Mandatory
2) nullifies on delete (I also tried the option to do nothing on
delete).
This is exactly like the classic "Movies" EOModel file Apple ships as
an example. They do the same thing with the "Talent" and "TalentPhoto"
tables.
=== D2W Limitation Description: ===
Maybe I'm just overlooking something, but for the past 7 days I have
been trying to get my basic D2W project to work. I can create a new
"Merchandise" entity and a new "Thumbnail" image just fine. This saves
to the database and works perfectly.
Problems arise when I try to edit an existing "Merchandise" instance
and update it with a new "Thumbnail" instance. It can't be done! The
framework keeps trying to save NULL for the primary key of the new
Thumbnail instance and therefore rejects the request to save changes.
=== Shred of Hope ===
I really want to work "with" WebObjects, not against it because "it
will win" - or so I've heard. I believe making custom "Property Level"
components best leverages the dynamic nature of D2W. I don't want to
freeze a page and do some clever hacking to try to get this case to
work.
I started poking around in "Project WOnder" and found
ERDEditOwnedRelationship and ERD2WTwoLevelEditToOneRelationship which
might do what I want, but they seem quite complex and I don't
understand the options that show up in the D2W configuration applet
when I select these relationships.
Thanks in advance,
-- Aaron
Author of the "Old Fart's Guide" series
http://www.cocoanutstech.com/
_______________________________________________
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