Re: Custom Class Problems
Re: Custom Class Problems
- Subject: Re: Custom Class Problems
- From: David Avendasora <email@hidden>
- Date: Sat, 18 Feb 2006 20:20:02 +0000
On Feb 17, 2006, at 12:24 PM, Ken Anderson wrote:
OK David, so it seems like you have a type issue somewhere. Can
you please post:
1. The section of Label.plist that deals with the part relationship
{
destination = Part;
isToMany = N;
joinSemantic = EOInnerJoin;
joins = ({destinationAttribute = partId; sourceAttribute
= partId; });
name = part;
},
2. The code that's calling setPart.
This is the frustrating thing. The UI that is calling it is one
entirely built using Assistant so I haven't actually written any Java
that calls this, just the built-in functionality you get in a basic
D2JC build.
Is #2 being done with KeyValue Coding, or by calling the method?
Or maybe by addObjectsToBothSidesOfRelationshipWithKey ? It seems
like you've having a problem where the method signatures don't match.
I'm assuming that since it is the standard Assistant generated/
configured interface that it is using key value-coding. How do I do a
debug on this? I'm a total newbie on Xcode/WO and I have not yet
figured out how to use the debugging tools and I think I'm at the
point I need to see exactly what is being called by what when I try
to set the part relationship through the UI.
Again, just to be clear, there is really no custom coding in these
custom classes so far, only that they have been defined as custom and
then the class files generated using either EOGenerator or EOModeler
(I get the same result using either).
I'm simply taking the EOModel and created a WO D2JC application using
the wizard. If all classes are EOGenericRecord it all works fine. If
JUST Label is a custom (com.bestmaid.erp.client.Label) class, then it
works also. If I make Part a custom (com.bestmaid.erp.client.Part) as
well, then it stops working. I can get it to work again by making the
modification shown below.
If anyone is interested, I'd be happy to include the entire EOModel
file and the associated custom Java classes.
I know this has to be something really simple that I'm missing
because this is such a core function of D2JC development that it
can't possibly be a bug that no one has ever found before. Can it?
Thanks,
Dave
Ken
On Feb 17, 2006, at 1:22 AM, David Avendasora wrote:
I've dug through the .plist files and everything looks right.
Here's the code that is generated (I've added a println() to it so
I can see when it executes:
public com.bestmaid.erp.client.Part part() {
return (com.bestmaid.erp.client.Part)storedValueForKey
("part");
}
public void setPart(com.bestmaid.erp.client.Part aValue) {
System.out.println("setPart");
takeStoredValueForKey(aValue, "part");
}
I get *nothing* in the console.
If I simply change the class from com.bestmaid.erp.client.Part to
EOGenericRecord below, it works.
public EOGenericRecord part() {
return (EOGenericRecord)storedValueForKey("part");
}
public void setPart(EOGenericRecord aValue) {
System.out.println("setPart");
takeStoredValueForKey(aValue, "part");
}
The Part is correctly set, and I get "setPart" in the console.
I am a newbie. Is there something wrong with the
"com.bestmaid.erp.client.Part" ?
Dave
_______________________________________________
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