[jira] Created: (CAY-1089) Generating SQLTemplate and Procedure Access Code

From: Andrus Adamchik (JIRA) ("Andrus)
Date: Sun Aug 03 2008 - 16:27:11 EDT

  • Next message: Andrus Adamchik (JIRA): "[jira] Updated: (CAY-1070) Generating SelectQuery Access Code"

    Generating SQLTemplate and Procedure Access Code
    ------------------------------------------------

                     Key: CAY-1089
                     URL: https://issues.apache.org/cayenne/browse/CAY-1089
                 Project: Cayenne
              Issue Type: Task
              Components: Cayenne Core Library
        Affects Versions: 3.0
                Reporter: Andrus Adamchik
                Assignee: Andrus Adamchik
                 Fix For: 3.0

    [Splitting from CAY-1070]

    The goal to generate a flexible type-safe code to invoke stored procedures and mapped SQLTemplates, similar to CAY-1070 implementation for SelectQueries.

    This feature should target class generation in "datamap" mode with Ant (via 'cgen' task [1]) and CayenneModeler (later this needs to be ported to the Maven plugin as well). For each ProcedureQuery and SQLTemplate query, a method would have to return a generic QueryResponse object, as we don't have enough info to tell whether the query is selecting or updating or both (although we can do something smart about SQLTemplates, such as greping for SELECT in the beginning of the query).

      public QueryResponse performQuery2(ObjectContext, Object parameter1, Object parameter2) {
       // bind parameters and
         // run the query here
      }

    The number, names and order of parameters must match that of the mapped query (not yet sure how to do with with SQLTemplate or ProcedureQuery). Also we need to do something smart about parameter types.

    For each stored procedure that does not have at least one procedure query, create a method that builds a procedure query on the fly. Method name is based on stored procedure name.

    public QueryResponse performProcedure2(ObjectContext, Object parameter1, Object parameter2) {
      // Create ProcedureQuery
     // bind parameters and
       // run the query here
    }

    [1] http://cayenne.apache.org/doc/cgen.html

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Sun Aug 03 2008 - 16:28:08 EDT