• 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
Qualifying Fetches on Attributes not in the EOModel
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Qualifying Fetches on Attributes not in the EOModel


  • Subject: Qualifying Fetches on Attributes not in the EOModel
  • From: David Avendasora <email@hidden>
  • Date: Mon, 27 Nov 2006 13:13:10 -0500

Hi all,

I want to build a fetch using attributes that are not in the EOModel because they are calculated. These attributes are updated regularly so using derived attributes in EOModel won't work.

I need to run a fetch for all "open" OrderItems. An "open" order item is simply an OrderItem that has a "scheduledQuantity" less than the "orderedQuantity" (or after doing the math, has an "openQuantity" greater-than 0).
orderedQuantity is a standard attribute that is persisted to the database. scheduledQuantity and openQuantity are not.

I get the scheduledQuantity for a given OrderItem using the following method:

public Number scheduledQuantity() {
Number scheduledQuantity = (Number)valueForKeyPath("email@hiddenuledQuantity");
return new Integer(scheduledQuantity.intValue());
}   

Which sums all the scheduledQuantity attributes of the related scheduledManufacturingOrderItem objects.


I calculate the openQuantity by:

    public Number openQuantity() {
        log.debug("Calculate openQuantity");
        int scheduledQuantity = scheduledQuantity().intValue();
        int orderedQuantity = orderedQuantity().intValue();
        int openQuantity = orderedQuantity - scheduledQuantity;
        return openQuantity;
    }

I want to fetch all the OrderItems from the database that have an openQuantity > 0, but since the attribute openQuantity is not in EOModeler I can't just simply fetch the same way, can I?

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

  • Follow-Ups:
    • Re: Qualifying Fetches on Attributes not in the EOModel
      • From: Ken Anderson <email@hidden>
  • Prev by Date: Re: Delete on cascade question
  • Next by Date: Re: Qualifying Fetches on Attributes not in the EOModel
  • Previous by thread: Re: Delete on cascade question
  • Next by thread: Re: Qualifying Fetches on Attributes not in the EOModel
  • Index(es):
    • Date
    • Thread