Fetch Spec. like Modeler

From: Sako! (webobject..tcc.datos.de)
Date: Mon Aug 30 2004 - 08:00:17 EDT

  • Next message: dragos moraru: "bug in modeler?!"

    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 - 08:02:35 EDT