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

Re: Question from an EOF neophyte


  • Subject: Re: Question from an EOF neophyte
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Wed, 17 May 2006 06:49:14 -0400

Hi, Jeff,

It's late and I don't have time to review your code carefully, but at a glance I saw nothing wrong.

Have you checked the value for "first" in the database? Is it possible that the value there is actually "first Jeff"?

Regards,
Jerry

On May 16, 2006, at 11:57 PM, Jeff Schmitz wrote:

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!


--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems


    email@hidden
    203 278-4085        office



_______________________________________________
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: Jeff Schmitz <email@hidden>
References: 
 >Question from an EOF neophyte (From: Jeff Schmitz <email@hidden>)

  • Prev by Date: Re: Best Way to communicate with Tomcat
  • Next by Date: Re: Question from an EOF neophyte
  • Previous by thread: Question from an EOF neophyte
  • Next by thread: Re: Question from an EOF neophyte
  • Index(es):
    • Date
    • Thread