Re: Another plea for help from a newbie[WORKAROUND]
Re: Another plea for help from a newbie[WORKAROUND]
- Subject: Re: Another plea for help from a newbie[WORKAROUND]
- From: Justin Tocci <email@hidden>
- Date: Sun, 6 Jun 2004 21:27:06 -0500
Ok, I gave up fighting WebObjects as of Saturday morning. Ultimately I
see that what I needed isn't documented well enough for my level of
Java skill.
For archive purposes I'll explain how I'm finishing this project.
I decided to re-write this conditional relationship query in such a way
that it could be followed through a simple inner-join one-to-many in
EOModeler with hidden primary and foreign keys just as if they were
normalized tables. This is a very well documented situation in
WebObjects and I am capable of following it.
I've never tried to normalize a table before. However, I have designed
them so know what I am trying to do. Immediately I realized I can't
normalize for real because of the legacy system. I had to simulate
normalization in a one hundred percent reliable way (even if a primary
key number should change).
The titemmaster table is a table of kits and has the primary key
titemmaster.id.
The tdrawing VIEW is the content within these kits formated in a
visually appealing way and has three keys.
Here is the xdrawing VIEW. It packages the tdrawing table in such a way
that it has a simulated foreign key:
CREATE OR REPLACE VIEW public.xdrawing AS
SELECT titemmaster.id, tdrawing.levelasubkit, tdrawing.levelbsubkit,
tdrawing.itemnumber, tdrawing.item, tdrawing.nsn, tdrawing.describes,
tdrawing.cage, tdrawing.alternateitem, tdrawing.itemqty,
tdrawing.levelaqty, tdrawing.levelbqty
FROM titemmaster
LEFT JOIN tdrawing
ON titemmaster.item = tdrawing.one OR titemmaster.item = tdrawing.two
OR titemmaster.item = tdrawing.three;
So:
titemmaster.id = xdrawing.id in EOModeler
yields
item = one OR item = two OR item = three
By wrapping the big complex tdrawing VIEW in a another VIEW rather than
re-write it, if the primary key changes it will change on both sides of
the relationship at the same time, preventing an error.
Thanks for all the help guys. I really appreciate it.
Justin Tocci
Fort Wayne, IN
PS Now when XCode finds an error in my code it is making me quit out
before letting me rebuild.
_______________________________________________
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.