Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 44045 invoked from network); 4 Nov 2009 21:55:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 Nov 2009 21:55:14 -0000 Received: (qmail 68438 invoked by uid 500); 4 Nov 2009 20:08:33 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 68389 invoked by uid 500); 4 Nov 2009 20:08:33 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 68378 invoked by uid 99); 4 Nov 2009 20:08:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2009 20:08:33 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gcjcu-cayenne-user-moved1@m.gmane.org designates 80.91.229.12 as permitted sender) Received: from [80.91.229.12] (HELO lo.gmane.org) (80.91.229.12) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 04 Nov 2009 20:08:22 +0000 Received: from list by lo.gmane.org with local (Exim 4.50) id 1N5m8x-0000xA-O2 for user@cayenne.apache.org; Wed, 04 Nov 2009 21:07:47 +0100 Received: from host-170-155-6-13.gba.gov.ar ([host-170-155-6-13.gba.gov.ar]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Nov 2009 21:07:47 +0100 Received: from dtoffe by host-170-155-6-13.gba.gov.ar with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 04 Nov 2009 21:07:47 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: user@cayenne.apache.org From: Daniel Toffetti Subject: Re: Code Generation for Stored Procedures Date: Wed, 4 Nov 2009 20:07:07 +0000 (UTC) Lines: 57 Message-ID: References: <5adb61290911041146t51a6221ch771a0d24bfef8c30@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 170.155.6.13 (Mozilla/5.0 (Windows; U; Windows NT 5.1; es-AR; rv:1.9.1.4) Gecko/20091016 Firefox/3.5.4) Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Michael Gentry masslight.net> writes: > > Hi Daniel, > > I'm assuming you've used the "Create Stored Procedure" button in > Cayenne Modeler? This doesn't actually create the stored procedure > itself (you can't type the SP definition into the modeler). What it > does is define/model a SP that you can use Cayenne to call through > your code. This probably isn't documented very well, but here is what > we currently have for calling the SP in your code: > > http://cayenne.apache.org/doc/stored-procedures.html > > mrg Thanks for the link, I've read it already. Ohh, now I understand, sorry if I wasn't clear enough. The stored procedures are already implemented in the database and the modeler retrieves them, but I was expecting some kind of code generation of a "dao" kind of class, think of something like this: public class MyCustomProcSPDAO { private Double outputParam; public Collection execute(String param1, Integer param2) { ProcedureQuery query = new ProcedureQuery("MyCustomProc"); query.addParam("param1", param1); query.addParam("param2", param2); QueryResponse result = ctxt.performGenericQuery(query); // retrieve output parameters outputParam = <<...>> //retrieve results as a type safe collection Collection resultCollection = <<...>> return resultCollection; } public Double getOutputParam() { return outputParam; } } Is this possible writing custom templates ?? Thanks and regards, Daniel