[OS-JIRA] Created: (CAY-131) Improve Query/FetchSpec handling for class generation

From: jir..bjectstyle.org
Date: Sun May 23 2004 - 18:34:46 EDT

  • Next message: jir..bjectstyle.org: "[OS-JIRA] Created: (CAY-132) missing toOne"

    Message:

      A new issue has been created in JIRA.

    ---------------------------------------------------------------------
    View the issue:

      http://objectstyle.org/jira/secure/ViewIssue.jspa?key=CAY-131

    Here is an overview of the issue:
    ---------------------------------------------------------------------
            Key: CAY-131
        Summary: Improve Query/FetchSpec handling for class generation
           Type: New Feature

         Status: Assigned
       Priority: Minor

        Project: Cayenne
     Components:
                 Cayenne Core Library
       Versions:
                 1.0 [STABLE]

       Assignee: Andrus Adamchik
       Reporter: Ian P. Cardenas

        Created: Sun, 23 May 2004 6:33 PM
        Updated: Sun, 23 May 2004 6:33 PM
    Environment: WOProject [DEV: eclipse_3_0_0], Mac OS X 10.3.3

    Description:
    It would be nice to be able to iterate over the fetchspecs stored in an EOModel when generating a class. For example (eogenerator syntax):

    <$foreach FetchSpec javaBeautifiedFetchSpecificationDictionaries..ortedNameArray do$>
        public static NSArray objectsWith<$FetchSpec.niceName$>(EOEditingContext context<$foreach Binding FetchSpec.bindings do2$>, <$Binding.codeType$><$Binding.name$>Binding<$endforeach do2$>) {
            NSMutableDictionary bindings = new NSMutableDictionary();
    <$if FetchSpec.bindings.count > 0$>
    <$foreach Binding FetchSpec.bindings do2$>
            if (<$Binding.name$>Binding != null)
                bindings.setObjectForKey(<$Binding.name$>Binding, "<$Binding.name$>");<$endforeach do2$>
    <$endif$>

            NSArray matchedObjects;
            try {
                matchedObjects = EOUtilities.objectsWithFetchSpecificationAndBindings(context, "<$name$>", "<$FetchSpec.fetchName$>", bindings);
            }
            catch (Exception e)
            {
              System.err.println(e);
              matchedObjects = new NSArray();
            }
            return matchedObjects;
        }

        public static <$classNameWithoutPackage$> objectWith<$FetchSpec.niceName$>(EOEditingContext context<$foreach Binding FetchSpec.bindings do3$>, <$Binding.codeType$><$Binding.name$>Binding<$endforeach do3$>) {
            NSArray matchedObjects = objectsWith<$FetchSpec.niceName$>(context<$foreach Binding FetchSpec.bindings do4$>, <$Binding.name$>Binding<$endforeach do4$>);
            return (<$classNameWithoutPackage$>)(matchedObjects.count() > 0 ? matchedObjects.objectAtIndex(0) : null);
        }

    <$endforeach do$>

    ---------------------------------------------------------------------
    JIRA INFORMATION:
    This message is automatically generated by JIRA.

    If you think it was sent incorrectly contact one of the administrators:
       http://objectstyle.org/jira/secure/Administrators.jspa

    If you want more information on JIRA, or have a bug to report see:
       http://www.atlassian.com/software/jira



    This archive was generated by hypermail 2.0.0 : Sun May 23 2004 - 18:34:47 EDT