Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 70950 invoked from network); 13 Apr 2005 19:04:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Apr 2005 19:04:18 -0000 Received: (qmail 7088 invoked by uid 500); 13 Apr 2005 19:04:17 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 7057 invoked by uid 500); 13 Apr 2005 19:04:16 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 86817 invoked by uid 99); 13 Apr 2005 12:49:20 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Message-ID: <1217239732.1113396556161.JavaMail.jira@ajax.apache.org> Date: Wed, 13 Apr 2005 14:49:16 +0200 (CEST) From: "Thomas Dudziak (JIRA)" To: ojb-dev@db.apache.org Subject: [jira] Commented: (OJB-16) Support stored procedures in select by pk statement In-Reply-To: <95010607.1112976316570.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/OJB-16?page=comments#action_62714 ] Thomas Dudziak commented on OJB-16: ----------------------------------- OJB uses the procedure whose name is given in the name attribute of the procedure element in the repository.xml. See here for the syntax of the already supported procedures: http://db.apache.org/ojb/docu/guides/repository.html#Stored+Procedure+Support > Support stored procedures in select by pk statement > --------------------------------------------------- > > Key: OJB-16 > URL: http://issues.apache.org/jira/browse/OJB-16 > Project: OJB > Type: New Feature > Components: PB-API > Versions: 1.0.x CVS > Reporter: Vadim Gritsenko > Assignee: Thomas Dudziak > Attachments: SelectByPKProcedureDescriptor.java, db-ojb-selectbypk.diff, xdoclet.diff > > This patch adds support for retrieving objects by primary keys through call to stored procedure instead of using select statement. > To activate the feature, add xdoclet tag to the class: > /** > * @ojb.class table="MYBEAN" > * @ojb.selectbypk-procedure name="FIND_MYBEAN_BYID" > */ > public class MyBean { > /** > * @ojb.field primarykey="true" > */ > Integer id; > } > And then, create stored procedure: > CREATE OR REPLACE PACKAGE TYPES AS > TYPE CURSORTYPE IS REF CURSOR; > END TYPES; > / > CREATE OR REPLACE FUNCTION FIND_MYBEAN_BYID (ANID IN MYBEAN.ID%TYPE) > RETURN TYPES.CURSORTYPE AS > RESULT TYPES.CURSORTYPE; > BEGIN > OPEN RESULT FOR SELECT * FROM MYBEAN WHERE ID = ANID; > RETURN RESULT; > END; > / > Patch is made against OJB_1_0_RELEASE branch. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.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 --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org