DB2 Optimize for clause enhancement

git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@510336 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David J. Wisneski 2007-02-22 01:03:06 +00:00
parent 2d3871b86b
commit 7eb91d0ec9
1 changed files with 210 additions and 211 deletions

View File

@ -195,16 +195,15 @@ public class DB2Dictionary
public String getOptimizeClause(JDBCFetchConfiguration fetch) { public String getOptimizeClause(JDBCFetchConfiguration fetch) {
Integer rows = null; Integer rows = null;
StringBuffer optimizeString = null; StringBuffer optimizeString = new StringBuffer();
if (fetch.getHint("openjpa.hint.optimize") != null) { if (fetch.getHint("openjpa.hint.optimize") != null) {
optimizeString = new StringBuffer();
rows = (Integer)fetch.getHint("openjpa.hint.optimize"); rows = (Integer)fetch.getHint("openjpa.hint.optimize");
optimizeString.append(" ").append(optimizeClause).append(" ") optimizeString.append(" ").append(optimizeClause).append(" ")
.append(rows).append(" "); .append(rows).append(" ");
if(rows.intValue() > 1) if (rows.intValue() > 1)
optimizeString.append(rowsClause).append(" "); optimizeString.append(rowsClause).append(" ");
else else
optimizeString.append(rowClause).append(" "); optimizeString.append(rowClause).append(" ");
} }
return optimizeString.toString(); return optimizeString.toString();
} }