Re: Fetch Spec. like Modeler

From: Sako! (webobject..tcc.datos.de)
Date: Mon Aug 30 2004 - 10:02:51 EDT

  • Next message: Andrus Adamchik: "Re: Fetch Spec. like Modeler"

    and how does the java code looks like to read the Query?

    regards.

    Sako

    ----- Original Message -----
    From: "Andrus Adamchik" <andru..bjectstyle.org>
    To: <cayenne-use..bjectstyle.org>
    Sent: Monday, August 30, 2004 3:58 PM
    Subject: Re: Fetch Spec. like 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 - 10:03:09 EDT