Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 364982

Summary: DBWS: need to handle processing simple, PL/SQL and Advanced JDBC args in a single code path
Product: z_Archived Reporter: David McCann <david.mccann>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: michael.norman
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Proposed fix to combine tow buildProcedureOperation methods into a single one.
none
Proposed fix to combine two buildProcedureOperation methods into a single one.
none
Proposed fix to combine two buildQueryForProcedureType methods into a single one.
none
Proposed fix to combine two buildQueryForProcedureType methods into a single one version 2. none

Description David McCann CLA 2011-11-28 12:40:48 EST
When generating query operations and calls, we currently split processing down separate code paths depending on whether we have simple or complex args, and in many places we again choose separate code paths depending on whether a given arg type is PL/SQL or Advanced JDBC.  Since we are now going to add support for mixing PL/SQL and Advanced JDBC args (with scalars) we need to consolidate the processing code such that it handles the various combinations of arg types in a single code path.
Comment 1 David McCann CLA 2011-11-28 12:44:58 EST
Created attachment 207612 [details]
Proposed fix to combine tow buildProcedureOperation methods into a single one.

This patch contains the first part of the fix for this issue.  Two buildProcedureOperation methods have been merged into a single one.  It uses a flag to indicate that the procedure(s) being processed are complex vs. simple - executing the various blocks of code accordingly.

A number of strings have also been replaced with statics in OracleHelper and Util.
Comment 2 David McCann CLA 2011-11-28 15:06:02 EST
Created attachment 207623 [details]
Proposed fix to combine two buildProcedureOperation methods into a single one.

Version #2.  Removed code that unnecessarily iterated over args and created two lists - one for procs with complex args, one for procs with simple args.
Comment 3 Mike Norman CLA 2011-11-28 15:09:43 EST
whew, that's a big diff! But it looks good
Comment 4 David McCann CLA 2011-11-28 16:26:08 EST
Fix part# 1 checked in to revision 10473
Reviewed by:  michael.norman@oracle.com
Tests:  all unit tests pass as expected
Comment 5 David McCann CLA 2011-11-29 11:37:22 EST
Created attachment 207663 [details]
Proposed fix to combine two buildQueryForProcedureType methods into a single one.

This fix combines buildQueryForPLSQLProcedureType and buildQueryForAdvancedJDBCProcedureType into a single method.  The code makes use of a flag that indicates whether the stored procedure has one or more PL/SQL arguments in order to execute the correct code blocks.
Comment 6 David McCann CLA 2011-11-29 11:56:27 EST
Created attachment 207666 [details]
Proposed fix to combine two buildQueryForProcedureType methods into a single one version 2.

Renamed the boolean from 'flag' to 'hasComplexArgs'
Comment 7 David McCann CLA 2011-11-29 12:32:25 EST
Fix part #2 checked into revision 10477 - combined query building logic into a single method
Reviewed by:  michael.norman@oracle.com
Tests:  all unit tests pass as expected
Comment 8 David McCann CLA 2012-01-06 11:05:00 EST
Query operation and call generation code has been modded to handle both PL/SQL and Advanced JDBC types in the same codepath.
Comment 9 Eclipse Webmaster CLA 2022-06-09 10:31:09 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink