[ http://issues.apache.org/jira/browse/OJB-16?page=comments#action_62718 ] Vadim Gritsenko commented on OJB-16: ------------------------------------
Please see above [1]: two procedures, IMHO, are more efficient (from performance POV) then single universal one. AFAIU, you had agreed with this conclusion [2] by saying "Yes, but...". So now we need to find a way to implement this, unless there are better suggestions. If problem is with the naming only, I can suggest following names: get-procedure find-procedure Let me know which way you want to proceed; so that I can modify patches accordingly. Thanks, Vadim [1] http://issues.apache.org/jira/browse/OJB-16#action_62501 [2] http://issues.apache.org/jira/browse/OJB-16#action_62502 > 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
