• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
What is the purpose of a WOOneTo Element?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What is the purpose of a WOOneTo Element?


  • Subject: What is the purpose of a WOOneTo Element?
  • From: Sam loy <email@hidden>
  • Date: Wed, 6 Jul 2005 17:39:48 -0500

I thought it was to set the attribute of a source entity with a value derived from a destination entity as defined by an established relationship create in EOModeler.  Apparently not, as when I run the program I get: 

com.webobjects.foundation.NSValidation$ValidationException: The country property of Addresses is not allowed to be null.

Reason:The country property of Addresses is not allowed to be null.

The UI displays the popups and values correctly. I set the the value in the UI, but when I submit, I get the above error.

Do I have to manually get the set value and stick it in the table before I submit? Here are some details:

I instantiate an Object "newPerson" of class "Person".
Person has a one-to-many called addresses to an Entity name Addresses.
I instantiate an Object "anAddress" of class "Address"
Address has several one-to-one relationships, in the above error, it is referring to the "country" relationship.

I drag a WOOneTo Element to the WOBuilder. I set the sourceRelationshipKey to "country", the sourceEntity to "Addresses", and the sourceObject to anAdress. 

When I click submit, registerPerson()  is called. Here is that function:
  public WOComponent registerPerson()
    {
        EOEditingContext ec = session().defaultEditingContext();
        ec.insertObject(anAddress);
        ec.insertObject(aPhoneNumber1);
        ec.insertObject(aPhoneNumber2);
        ec.insertObject(anEmailAddr1);
        ec.insertObject(anEmailAddr2);
        newPerson.addObjectToBothSidesOfRelationshipWithKey(anAddress, "addressess");
        newPerson.addObjectToBothSidesOfRelationshipWithKey(aPhoneNumber1, "phoneNumberss");
        newPerson.addObjectToBothSidesOfRelationshipWithKey(aPhoneNumber2, "phoneNumberss");
        newPerson.addObjectToBothSidesOfRelationshipWithKey(anEmailAddr1, "emailAddrss");
        newPerson.addObjectToBothSidesOfRelationshipWithKey(anEmailAddr2, "emailAddrss");
        
        ec.insertObject(newPerson);
        ec.saveChanges();
        return null;
    }

 _______________________________________________
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

  • Prev by Date: Re: Accessing Open Directory Information
  • Next by Date: What is the purpose of a WOOneTo Element?
  • Previous by thread: Re: omnigraffle
  • Next by thread: What is the purpose of a WOOneTo Element?
  • Index(es):
    • Date
    • Thread