1 19 20 package org.apache.cayenne.dba.hsqldb; 21 22 import org.apache.cayenne.access.trans.ProcedureTranslator; 23 import org.apache.cayenne.map.Procedure; 24 25 31 public class HSQLDBProcedureTranslator extends ProcedureTranslator { 32 33 36 protected String createSqlString() { 37 Procedure procedure = getProcedure(); 38 39 StringBuffer buf = new StringBuffer (); 40 41 int totalParams = callParams.size(); 42 43 if (procedure.isReturningValue()) { 45 totalParams--; 46 47 49 buf.append("{?= call "); 53 } 54 else { 55 buf.append("{call "); 56 } 57 58 if (procedure.getFullyQualifiedName().indexOf('.') > -1) { 61 buf.append("\"").append(procedure.getFullyQualifiedName()).append("\""); 62 } 63 else { 64 buf.append(procedure.getFullyQualifiedName()); 65 } 66 67 if (totalParams > 0) { 68 buf.append("(?"); 70 71 for (int i = 1; i < totalParams; i++) { 72 buf.append(", ?"); 73 } 74 75 buf.append(")"); 76 } 77 78 buf.append("}"); 79 return buf.toString(); 80 } 81 } 82 | Popular Tags |