• 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
Question from an EOF neophyte
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Question from an EOF neophyte


  • Subject: Question from an EOF neophyte
  • From: Jeff Schmitz <email@hidden>
  • Date: Tue, 16 May 2006 22:57:24 -0500

I'm currently using classes that inherit from EOGenericRecord for my enterprise objects.  When I retrieve a string value from one of the functions in an EO class directly, things work fine.  However, when I follow a relationship to call a function on a related enterprise object, both the key and the value are concantenated into a string that is returned from the function.  Why am I getting the key as part of the string?  Below is an example call that I'm making.

System.out.println(((EOEntries)entryList.objectAtIndex(0)).user().first());

This prints out (for example) "first Jeff" instead of just "Jeff"

Below are my edited EO classes showing the pertinent functions:

import com.webobjects.foundation.*;
import com.webobjects.eocontrol.*;
import java.math.BigDecimal;
import java.util.*;

public class EOEntries extends EOGenericRecord {

    public EOEntries() {
        super();
    }


    public String name() {
        return (String)storedValueForKey("name");
    }

    public EOUser user() {
        return (EOUser)storedValueForKey("user");
    }

}

// EOUser.java
// Created on Thu May 11 21:37:37 US/Central 2006 by Apple EOModeler Version 5.2

import com.webobjects.foundation.*;
import com.webobjects.eocontrol.*;
import java.math.BigDecimal;
import java.util.*;

public class EOUser extends EOGenericRecord {

    public EOUser() {
        super();
    }


    public String first() {
        return (String)storedValueForKey("first");
    }


    public NSArray entries() {
        return (NSArray)storedValueForKey("entries");
    }

    public void setEntries(NSArray value) {
        takeStoredValueForKey(value, "entries");
    }

    public void addToEntries(EOEntries object) {
        includeObjectIntoPropertyWithKey(object, "entries");
    }

    public void removeFromEntries(EOEntries object) {
        excludeObjectFromPropertyWithKey(object, "entries");
    }
}

Thanks,

http://www.netbrackets.com - nothin' but net!



 _______________________________________________
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

  • Follow-Ups:
    • Re: Question from an EOF neophyte
      • From: "Jerry W. Walker" <email@hidden>
  • Prev by Date: Re: NSTimestampFormatter DECREMENTING 'day' on each pass
  • Next by Date: Re: Best Way to communicate with Tomcat
  • Previous by thread: Re: Is it possible to get a WebObjects demo?
  • Next by thread: Re: Question from an EOF neophyte
  • Index(es):
    • Date
    • Thread