Re: Setting a Default toOne Relationship
Re: Setting a Default toOne Relationship
- Subject: Re: Setting a Default toOne Relationship
- From: David Avendasora <email@hidden>
- Date: Tue, 30 May 2006 15:54:31 +0100
On May 25, 2006, at 5:21 PM, Chuck Hill wrote:
That is what I would expect. awakeFromInsertion should be
processed client side.
Not according to the documentation! It says:
<snip>
Add this code in the server-side Student.java file:
public void awakeFromInsertion(EOEditingContext context) {
super.awakeFromInsertion(context);
if (gpa() == null) {
setGpa(new BigDecimal("0"));
}
</snip>
But THAT doesn't work. It works fine on the client-side where YOU say
it should so fine, the documentation is wrong. Now, I need to do a
fetch (to get the related object) as part of awakeFromInsertion() and
that won't work on the client-side. It never executes. The DB never
sees a request. Any ideas?
I've tried using invokeRemoteMethod() and having the server-side
class do the fetch and set the relationship, but apparently when you
use the invokeRemoteMethod() method, WO actually validates and saves
the instance to the DB, which it can't because none of the required
values / mandatory relationships aren't set yet - which is what I'm
trying to do!!!! Ahg!
Does anyone have any idea on how to set a default relationship in
Java Client when the related object already is in the DB and needs to
be looked-up? Nothing seems to work for me.
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