KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > oracle > toplink > essentials > internal > databaseaccess > DatasourceCall


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the "License"). You may not use this file except
5  * in compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * glassfish/bootstrap/legal/CDDLv1.0.txt or
9  * https://glassfish.dev.java.net/public/CDDLv1.0.html.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * HEADER in each file and include the License file at
15  * glassfish/bootstrap/legal/CDDLv1.0.txt. If applicable,
16  * add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your
18  * own identifying information: Portions Copyright [yyyy]
19  * [name of copyright owner]
20  */

21 // Copyright (c) 1998, 2006, Oracle. All rights reserved.
22
package oracle.toplink.essentials.internal.databaseaccess;
23
24 import java.util.*;
25 import java.io.*;
26 import oracle.toplink.essentials.exceptions.*;
27 import oracle.toplink.essentials.queryframework.*;
28 import oracle.toplink.essentials.internal.helper.*;
29 import oracle.toplink.essentials.internal.queryframework.*;
30 import oracle.toplink.essentials.internal.expressions.*;
31 import oracle.toplink.essentials.internal.sessions.AbstractRecord;
32 import oracle.toplink.essentials.internal.sessions.AbstractSession;
33
34 /**
35  * INTERNAL:
36  * <b>Purpose<b>: Used as an abstraction of a datasource invocation.
37  *
38  * @author James Sutherland
39  * @since OracleAS TopLink 10<i>g</i> (10.0.3)
40  */

41 public abstract class DatasourceCall implements Call {
42     // Back reference to query, unfortunately required for events.
43
protected DatabaseQuery query;
44
45     // The parameters (values) are ordered as they appear in the call.
46
transient protected Vector parameters;
47
48     // The parameter types determine if the parameter is a modify, translation or literal type.
49
transient protected Vector parameterTypes;
50     public static final Integer JavaDoc LITERAL = new Integer JavaDoc(1);
51     public static final Integer JavaDoc MODIFY = new Integer JavaDoc(2);
52     public static final Integer JavaDoc TRANSLATION = new Integer JavaDoc(3);
53     public static final Integer JavaDoc CUSTOM_MODIFY = new Integer JavaDoc(4);
54     public static final Integer JavaDoc OUT = new Integer JavaDoc(5);
55     public static final Integer JavaDoc INOUT = new Integer JavaDoc(6);
56     public static final Integer JavaDoc IN = new Integer JavaDoc(7);
57     public static final Integer JavaDoc OUT_CURSOR = new Integer JavaDoc(8);
58
59     // Store if the call has been prepared.
60
protected boolean isPrepared;
61
62     // Type of call.
63
protected int returnType;
64     protected static final int NO_RETURN = 1;
65     protected static final int RETURN_ONE_ROW = 2;
66     protected static final int RETURN_MANY_ROWS = 3;
67     protected static final int RETURN_CURSOR = 4;
68
69     public DatasourceCall() {
70         this.isPrepared = false;
71         this.returnType = RETURN_MANY_ROWS;
72     }
73
74     /**
75      * The parameters are the values in order of occurance in the SQL statement.
76      * This is lazy initialized to conserv space on calls that have no parameters.
77      */

78     public Vector getParameters() {
79         if (parameters == null) {
80             parameters = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
81         }
82         return parameters;
83     }
84
85     /**
86      * The parameter types determine if the parameter is a modify, translation or litteral type.
87      */

88     public Vector getParameterTypes() {
89         if (parameterTypes == null) {
90             parameterTypes = oracle.toplink.essentials.internal.helper.NonSynchronizedVector.newInstance();
91         }
92         return parameterTypes;
93     }
94
95     /**
96      * The parameters are the values in order of occurance in the SQL statement.
97      */

98     public void setParameters(Vector parameters) {
99         this.parameters = parameters;
100     }
101
102     /**
103      * The parameter types determine if the parameter is a modify, translation or litteral type.
104      */

105     public void setParameterTypes(Vector parameterTypes) {
106         this.parameterTypes = parameterTypes;
107     }
108
109     /**
110      * The parameters are the values in order of occurance in call.
111      * This is lazy initialized to conserv space on calls that have no parameters.
112      */

113     public boolean hasParameters() {
114         return (parameters != null) && (!getParameters().isEmpty());
115     }
116
117     /**
118      * The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
119      */

120     public boolean areManyRowsReturned() {
121         return getReturnType() == RETURN_MANY_ROWS;
122     }
123
124     public boolean isOutputParameterType(Integer JavaDoc parameterType) {
125         return (parameterType == OUT) || (parameterType == INOUT) || (parameterType == OUT_CURSOR);
126     }
127
128     /**
129      * Bound calls can have the SQL pre generated.
130      */

131     protected boolean isPrepared() {
132         return isPrepared;
133     }
134
135     /**
136      * Bound calls can have the SQL pre generated.
137      */

138     protected void setIsPrepared(boolean isPrepared) {
139         this.isPrepared = isPrepared;
140     }
141
142     /**
143      * Return the appropriate mechanism,
144      * with the call added as necessary.
145      */

146     public DatabaseQueryMechanism buildNewQueryMechanism(DatabaseQuery query) {
147         return new DatasourceCallQueryMechanism(query, this);
148     }
149
150     /**
151      * Return the appropriate mechanism,
152      * with the call added as necessary.
153      */

154     public DatabaseQueryMechanism buildQueryMechanism(DatabaseQuery query, DatabaseQueryMechanism mechanism) {
155         if (mechanism.isCallQueryMechanism() && (mechanism instanceof DatasourceCallQueryMechanism)) {
156             // Must also add the call singleton...
157
DatasourceCallQueryMechanism callMechanism = ((DatasourceCallQueryMechanism)mechanism);
158             if (!callMechanism.hasMultipleCalls()) {
159                 callMechanism.addCall(callMechanism.getCall());
160                 callMechanism.setCall(null);
161             }
162             callMechanism.addCall(this);
163             return mechanism;
164         } else {
165             return buildNewQueryMechanism(query);
166         }
167     }
168
169     public Object JavaDoc clone() {
170         try {
171             return super.clone();
172         } catch (CloneNotSupportedException JavaDoc exception) {
173             ;//Do nothing
174
}
175
176         return null;
177     }
178
179     /**
180      * Return the SQL string for logging purposes.
181      */

182     public abstract String JavaDoc getLogString(Accessor accessor);
183
184     /**
185      * Back reference to query, unfortunately required for events.
186      */

187     public DatabaseQuery getQuery() {
188         return query;
189     }
190
191     /**
192      * The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
193      */

194     public int getReturnType() {
195         return returnType;
196     }
197
198     /**
199      * The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
200      */

201     public boolean isCursorReturned() {
202         return getReturnType() == RETURN_CURSOR;
203     }
204
205     /**
206      * Return whether all the results of the call have been returned.
207      */

208     public boolean isFinished() {
209         return !isCursorReturned();
210     }
211
212     /**
213      * The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
214      */

215     public boolean isNothingReturned() {
216         return getReturnType() == NO_RETURN;
217     }
218
219     /**
220      * The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
221      */

222     public boolean isOneRowReturned() {
223         return getReturnType() == RETURN_ONE_ROW;
224     }
225
226     public boolean isSQLCall() {
227         return false;
228     }
229
230     public boolean isStoredFunctionCall() {
231         return false;
232     }
233
234     public boolean isStoredProcedureCall() {
235         return false;
236     }
237
238     public boolean isEJBQLCall() {
239         return false;
240     }
241
242     public boolean isEISInteraction() {
243         return false;
244     }
245
246     public boolean isQueryStringCall() {
247         return false;
248     }
249
250     /**
251      * Allow pre-printing of the query/SQL string for fully bound calls, to save from reprinting.
252      */

253     public void prepare(AbstractSession session) {
254         setIsPrepared(true);
255     }
256
257     /**
258      * Cursor return is used for cursored streams.
259      */

260     public void returnCursor() {
261         setReturnType(RETURN_CURSOR);
262     }
263
264     /**
265      * Many rows are returned for read-all queries.
266      */

267     public void returnManyRows() {
268         setReturnType(RETURN_MANY_ROWS);
269     }
270
271     /**
272      * No return is used for modify calls like insert / update / delete.
273      */

274     public void returnNothing() {
275         setReturnType(NO_RETURN);
276     }
277
278     /**
279      * One row is returned for read-object queries.
280      */

281     public void returnOneRow() {
282         setReturnType(RETURN_ONE_ROW);
283     }
284
285     /**
286      * Back reference to query, unfortunately required for events.
287      */

288     public void setQuery(DatabaseQuery query) {
289         this.query = query;
290     }
291
292     /**
293      * The return type is one of, NoReturn, ReturnOneRow or ReturnManyRows.
294      */

295     public void setReturnType(int returnType) {
296         this.returnType = returnType;
297     }
298
299     /**
300      * Allow the call to translate from the translation for predefined calls.
301      */

302     public void translate(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session) {
303         //do nothing by default.
304
}
305
306     /**
307      * Return the query string of the call.
308      * This must be overwritten by subclasses that support query language translation (SQLCall, XQueryCall).
309      */

310     public String JavaDoc getQueryString() {
311         return "";
312     }
313
314     /**
315      * Set the query string of the call.
316      * This must be overwritten by subclasses that support query language translation (SQLCall, XQueryCall).
317      */

318     public void setQueryString(String JavaDoc queryString) {
319         // Nothing by default.
320
}
321
322     /**
323      * INTERNAL:
324      * Parse the query string for # markers for custom query based on a query language.
325      * This is used by SQLCall and XQuery call, but can be reused by other query languages.
326      */

327     public void translateCustomQuery() {
328         if (getQueryString().indexOf("#") == -1) {
329             if (this.getQuery().shouldBindAllParameters() && getQueryString().indexOf("?") == -1){
330                 return;
331             }
332             translatePureSQLCustomQuery();
333             return;
334         }
335
336         int lastIndex = 0;
337         int litteralIndex = 0;// This index is used to determine the position of litterals
338
String JavaDoc queryString = getQueryString();
339         Writer writer = new CharArrayWriter(queryString.length() + 50);
340         try {
341             // ** This method is heavily optimized do not touch anyhthing unless you "know" what your doing.
342
while (lastIndex != -1) {
343                 int poundIndex = queryString.indexOf('#', lastIndex);
344                 String JavaDoc token;
345                 if (poundIndex == -1) {
346                     token = queryString.substring(lastIndex, queryString.length());
347                     lastIndex = -1;
348                 } else {
349                     token = queryString.substring(lastIndex, poundIndex);
350                 }
351                 writer.write(token);
352                 if (poundIndex != -1) {
353                     int wordEndIndex = poundIndex + 1;
354                     while ((wordEndIndex < queryString.length()) && (whitespace().indexOf(queryString.charAt(wordEndIndex)) == -1)) {
355                         wordEndIndex = wordEndIndex + 1;
356                     }
357
358                     // Check for ## which means field from modify row.
359
if (queryString.charAt(poundIndex + 1) == '#') {
360                         // Check for ### which means OUT parameter type.
361
if (queryString.charAt(poundIndex + 2) == '#') {
362                             // Check for #### which means INOUT parameter type.
363
if (queryString.charAt(poundIndex + 3) == '#') {
364                                 String JavaDoc fieldName = queryString.substring(poundIndex + 4, wordEndIndex);
365                                 DatabaseField field = createField(fieldName);
366                                 appendInOut(writer, field);
367                             } else {
368                                 String JavaDoc fieldName = queryString.substring(poundIndex + 3, wordEndIndex);
369                                 DatabaseField field = createField(fieldName);
370                                 appendOut(writer, field);
371                             }
372                         } else {
373                             String JavaDoc fieldName = queryString.substring(poundIndex + 2, wordEndIndex);
374                             DatabaseField field = createField(fieldName);
375                             appendModify(writer, field);
376                         }
377                     } else {
378                         String JavaDoc fieldName = queryString.substring(poundIndex + 1, wordEndIndex);
379                         DatabaseField field = createField(fieldName);
380                         appendIn(writer, field);
381                     }
382                     lastIndex = wordEndIndex;
383                 }
384             }
385             setQueryString(writer.toString());
386         } catch (IOException exception) {
387             throw ValidationException.fileError(exception);
388         }
389     }
390
391     /**
392      * INTERNAL:
393      * Parse the query string for # markers for custom query based on a query language.
394      * This is used by SQLCall and XQuery call, but can be reused by other query languages.
395      */

396     public void translatePureSQLCustomQuery() {
397         int lastIndex = 0;
398         String JavaDoc queryString = getQueryString();
399         int parameterIndex = 1; // this is the parameter index
400
Writer writer = new CharArrayWriter(queryString.length() + 50);
401         try {
402             // ** This method is heavily optimized do not touch anyhthing unless you "know" what your doing.
403
while (lastIndex != -1) {
404                 int markIndex = queryString.indexOf('?', lastIndex);
405                 String JavaDoc token;
406                 if (markIndex == -1) { // did not find question mark then we are done looking
407
token = queryString.substring(lastIndex, queryString.length()); //write rest of sql
408
lastIndex = -1;
409                 } else {
410                     token = queryString.substring(lastIndex, markIndex);
411                     lastIndex = markIndex + 1;
412                 }
413                 writer.write(token);
414                 if (markIndex != -1) { // found the question mark now find the named token
415
int wordEndIndex = markIndex + 1;
416                     while ((wordEndIndex < queryString.length()) && (whitespace().indexOf(queryString.charAt(wordEndIndex)) == -1)) {
417                         wordEndIndex = wordEndIndex + 1;
418                     }
419                     if (wordEndIndex > markIndex + 1){ //found a 'name' for this token (may be positional)
420
String JavaDoc fieldName = queryString.substring(markIndex + 1, wordEndIndex);
421                         DatabaseField field = createField(fieldName);
422                         appendIn(writer, field);
423                         lastIndex = wordEndIndex;
424                     }else{
425                         DatabaseField field = createField(String.valueOf(parameterIndex));
426                         parameterIndex++;
427                         appendIn(writer, field);
428                     }
429                 }
430             }
431         } catch (IOException exception) {
432             throw ValidationException.fileError(exception);
433         }
434         setQueryString(writer.toString());
435     }
436
437     /**
438      * INTERNAL:
439      * Create a new Database Field
440      * This method can be overridden by subclasses to return other field types
441      */

442     protected DatabaseField createField(String JavaDoc fieldName) {
443         return new DatabaseField(fieldName);
444     }
445
446     /**
447      * INTERNAL:
448      * All values are printed as ? to allow for parameter binding or translation during the execute of the call.
449      */

450     public void appendLiteral(Writer writer, Object JavaDoc literal) {
451         try {
452             writer.write(argumentMarker());
453         } catch (IOException exception) {
454             throw ValidationException.fileError(exception);
455         }
456         getParameters().addElement(literal);
457         getParameterTypes().addElement(LITERAL);
458     }
459
460     /**
461      * INTERNAL:
462      * All values are printed as ? to allow for parameter binding or translation during the execute of the call.
463      */

464     public void appendTranslation(Writer writer, DatabaseField modifyField) {
465         try {
466             writer.write(argumentMarker());
467         } catch (IOException exception) {
468             throw ValidationException.fileError(exception);
469         }
470         getParameters().addElement(modifyField);
471         getParameterTypes().addElement(TRANSLATION);
472     }
473
474     /**
475      * INTERNAL:
476      * All values are printed as ? to allow for parameter binding or translation during the execute of the call.
477      */

478     public void appendModify(Writer writer, DatabaseField modifyField) {
479         try {
480             writer.write(argumentMarker());
481         } catch (IOException exception) {
482             throw ValidationException.fileError(exception);
483         }
484         getParameters().addElement(modifyField);
485         getParameterTypes().addElement(MODIFY);
486     }
487
488     /**
489      * INTERNAL:
490      * All values are printed as ? to allow for parameter binding or translation during the execute of the call.
491      */

492     public void appendIn(Writer writer, DatabaseField field) {
493         try {
494             writer.write(argumentMarker());
495         } catch (IOException exception) {
496             throw ValidationException.fileError(exception);
497         }
498         getParameters().addElement(field);
499         getParameterTypes().addElement(IN);
500     }
501
502     /**
503      * INTERNAL:
504      * All values are printed as ? to allow for parameter binding or translation during the execute of the call.
505      */

506     public void appendInOut(Writer writer, DatabaseField inoutField) {
507         try {
508             writer.write(argumentMarker());
509         } catch (IOException exception) {
510             throw ValidationException.fileError(exception);
511         }
512         Object JavaDoc[] inOut = { inoutField, inoutField };
513         getParameters().addElement(inOut);
514         getParameterTypes().addElement(INOUT);
515     }
516
517     /**
518      * INTERNAL:
519      * All values are printed as ? to allow for parameter binding or translation during the execute of the call.
520      */

521     public void appendOut(Writer writer, DatabaseField outField) {
522         try {
523             writer.write(argumentMarker());
524         } catch (IOException exception) {
525             throw ValidationException.fileError(exception);
526         }
527         getParameters().addElement(outField);
528         getParameterTypes().addElement(OUT);
529     }
530
531     /**
532      * Add the parameter.
533      * If using binding bind the parameter otherwise let the platform print it.
534      * The platform may also decide to bind the value.
535      */

536     public void appendParameter(Writer writer, Object JavaDoc parameter, AbstractSession session) {
537         session.getDatasourcePlatform().appendParameter(this, writer, parameter);
538     }
539
540     /**
541      * INTERNAL:
542      * Return the character to use for the argument marker.
543      * ? is used in SQL, however other query languages such as XQuery need to use other markers.
544      */

545     protected char argumentMarker() {
546         return '?';
547     }
548
549     /**
550      * INTERNAL:
551      * Return the characters that represent non-arguments names.
552      */

553     protected String JavaDoc whitespace() {
554         return ",); \n\t:";
555     }
556
557     /**
558      * INTERNAL:
559      * Allow the call to translate from the translation for predefined calls.
560      */

561     public void translateQueryString(AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session) {
562         if (getQueryString().indexOf(argumentMarker()) == -1) {
563             return;
564         }
565
566         //has a '?'
567
if (getParameters().isEmpty()) {
568             //has no parameters
569
return;
570         }
571
572         int lastIndex = 0;
573         int parameterIndex = 0;
574         String JavaDoc queryString = getQueryString();
575         Writer writer = new CharArrayWriter(queryString.length() + 50);
576         try {
577             // ** This method is heavily optimized do not touch anyhthing unless you know "very well" what your doing!!
578
// Must translate field parameters and may get new bound parameters for large data.
579
Vector parameterFields = getParameters();
580             setParameters(null);
581             while (lastIndex != -1) {
582                 int tokenIndex = queryString.indexOf(argumentMarker(), lastIndex);
583                 String JavaDoc token;
584                 if (tokenIndex == -1) {
585                     token = queryString.substring(lastIndex, queryString.length());
586                     lastIndex = -1;
587                 } else {
588                     token = queryString.substring(lastIndex, tokenIndex);
589                 }
590                 writer.write(token);
591                 if (tokenIndex != -1) {
592                     // Process next parameter.
593
Integer JavaDoc parameterType = (Integer JavaDoc)getParameterTypes().elementAt(parameterIndex);
594                     if (parameterType == MODIFY) {
595                         DatabaseField field = (DatabaseField)parameterFields.elementAt(parameterIndex);
596                         Object JavaDoc value = modifyRow.get(field);
597                         appendParameter(writer, value, session);
598                     } else if (parameterType == CUSTOM_MODIFY) {
599                         DatabaseField field = (DatabaseField)parameterFields.elementAt(parameterIndex);
600                         Object JavaDoc value = modifyRow.get(field);
601                         if (value != null) {
602                             value = session.getDatasourcePlatform().getCustomModifyValueForCall(this, value, field, false);
603                         }
604                         appendParameter(writer, value, session);
605                     } else if (parameterType == TRANSLATION) {
606                         Object JavaDoc parameter = parameterFields.elementAt(parameterIndex);
607                         Object JavaDoc value = null;
608
609                         // Parameter expressions are used for nesting and correct mapping conversion of the value.
610
if (parameter instanceof ParameterExpression) {
611                             value = ((ParameterExpression)parameter).getValue(translationRow, session);
612                         } else {
613                             DatabaseField field = (DatabaseField)parameter;
614                             value = translationRow.get(field);
615                             // Must check for the modify row as well for custom SQL compatibility as only one # is required.
616
if ((value == null) && (modifyRow != null)) {
617                                 value = modifyRow.get(field);
618                             }
619                         }
620                         appendParameter(writer, value, session);
621                     } else if (parameterType == LITERAL) {
622                         Object JavaDoc value = parameterFields.elementAt(parameterIndex);
623                         appendParameter(writer, value, session);
624                     } else if (parameterType == IN) {
625                         Object JavaDoc parameter = parameterFields.elementAt(parameterIndex);
626                         Object JavaDoc value = getValueForInParameter(parameter, translationRow, modifyRow, session, false);
627                         appendParameter(writer, value, session);
628                     } else if (parameterType == INOUT) {
629                         Object JavaDoc parameter = parameterFields.elementAt(parameterIndex);
630                         Object JavaDoc value = getValueForInOutParameter(parameter, translationRow, modifyRow, session);
631                         appendParameter(writer, value, session);
632                     }
633                     lastIndex = tokenIndex + 1;
634                     parameterIndex++;
635                 }
636             }
637
638             setQueryString(writer.toString());
639
640         } catch (IOException exception) {
641             throw ValidationException.fileError(exception);
642         }
643     }
644
645     /**
646      * INTERNAL:
647      * Returns value for IN parameter. Called by translate and translateSQLString methods.
648      * In case shouldBind==true tries to return a DatabaseField with type instead of null,
649      * returns null only in case no DatabaseField with type was found.
650      */

651     protected Object JavaDoc getValueForInParameter(Object JavaDoc parameter, AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session, boolean shouldBind) {
652         Object JavaDoc value = parameter;
653
654         // Parameter expressions are used for nesting and correct mapping conversion of the value.
655
if (parameter instanceof ParameterExpression) {
656             value = ((ParameterExpression)parameter).getValue(translationRow, session);
657         } else if (parameter instanceof DatabaseField) {
658             DatabaseField field = (DatabaseField)parameter;
659             value = translationRow.get(field);
660             // Must check for the modify row as well for custom SQL compatibility as only one # is required.
661
if (modifyRow != null) {
662                 if (value == null) {
663                     value = modifyRow.get(field);
664                 }
665                 if (value != null) {
666                     DatabaseField modifyField = modifyRow.getField(field);
667                     if (modifyField != null) {
668                         if (session.getDatasourcePlatform().shouldUseCustomModifyForCall(modifyField)) {
669                             value = session.getDatasourcePlatform().getCustomModifyValueForCall(this, value, modifyField, shouldBind);
670                         }
671                     }
672                 }
673             }
674             if ((value == null) && shouldBind) {
675                 if (field.getType() != null) {
676                     value = field;
677                 } else if (modifyRow != null) {
678                     DatabaseField modifyField = modifyRow.getField(field);
679                     if ((modifyField != null) && (modifyField.getType() != null)) {
680                         value = modifyField;
681                     }
682                 }
683                 if (value == null) {
684                     DatabaseField translationField = translationRow.getField(field);
685                     if (translationField == null){
686                         throw QueryException.namedArgumentNotFoundInQueryParameters(field.getName());
687                     }
688                     if (translationField.getType() != null) {
689                         value = translationField;
690                     }
691                 }
692             }
693         }
694         return value;
695     }
696
697     /**
698      * INTERNAL:
699      * Returns value for INOUT parameter. Called by translate and translateSQLString methods.
700      */

701     protected Object JavaDoc getValueForInOutParameter(Object JavaDoc parameter, AbstractRecord translationRow, AbstractRecord modifyRow, AbstractSession session) {
702         // parameter ts an array of two Objects: inParameter and outParameter
703
Object JavaDoc inParameter = ((Object JavaDoc[])parameter)[0];
704         Object JavaDoc inValue = getValueForInParameter(inParameter, translationRow, modifyRow, session, true);
705         Object JavaDoc outParameter = ((Object JavaDoc[])parameter)[1];
706         return createInOutParameter(inValue, outParameter, session);
707     }
708
709     /**
710      * INTERNAL:
711      * Returns INOUT parameter. Called by getValueForInOutParameter method.
712      * Descendents may override this method.
713      */

714     protected Object JavaDoc createInOutParameter(Object JavaDoc inValue, Object JavaDoc outParameter, AbstractSession session) {
715         Object JavaDoc[] inOut = { inValue, outParameter };
716         return inOut;
717     }
718 }
719
Popular Tags