Re: Fetch Spec. like Modeler

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Mon Aug 30 2004 - 09:58:40 EDT

  • Next message: Andrus Adamchik: "Re: bug in modeler?!"

    What you need to here is to create a new query using the right-most
    button on the toolbar. When the modeler asks for the type of query, use
    "Object Query". Then for the qualifier use "nr = $nr" - very similar to
    EOF.

    Andrus

    On Aug 30, 2004, at 8:00 AM, Sako! wrote:

    > Hello,
    > i would like to know if i can create a Fetch Specification in Cayenne
    > like in EOModeler.
    > i mean i want to get the Qualifier in Cayenne like this :
    >  
    > Ads.fspec file
    > -------------------------------------------------------------
    > {
    >     "Fetch Ads" = {
    >         class = EOFetchSpecification;
    >         entityName = Ads;
    >         fetchLimit = 0;
    >         isDeep = YES;
    >         qualifier = {
    >             class = EOKeyValueQualifier;
    >             key = nr;
    >             selectorName = "isEqualTo:";
    >             value = {_key = nr; class = EOQualifierVariable; };
    >         };
    >         refreshesRefetchedObjects = YES;
    >         requiresAllQualifierBindingVariables = YES;
    >     };
    > }
    > -------------------------------------------------------------
    > Qualifier in EOModeler
    > (nr= $nr)
    >  
    > Code in java :
    >
    > EOFetchSpecification fs =
    > EOFetchSpecification.fetchSpecificationNamed(fetch, entity);
    >
    >  
    >
    > NSMutableDictionary bindings = new NSMutableDictionary();
    >
    > bindings.setObjectForKey(specialistNr, "nr"); // specialistNr Integer
    >
    > fs = fs.fetchSpecificationWithQualifierBindings(bindings);
    >
    > NSArray objects = ec.objectsWithFetchSpecification(fs); // ec
    > EdetingContext
    >
    > if (objects.count() > 0)
    >
    > {
    >
    >        return (EOGenericRecord) objects.objectAtIndex(0);
    >
    > }
    >
    > else
    >
    > {
    >
    >        return null;
    >
    > }
    > -------------------------------------------------------------
    >  
    > if possilbe please give me the url how to use that.
    >  
    > Regards.
    >  
    > Sako.



    This archive was generated by hypermail 2.0.0 : Mon Aug 30 2004 - 09:58:46 EDT