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,13 +195,12 @@ public class DB2Dictionary
public String getOptimizeClause(JDBCFetchConfiguration fetch) {
Integer rows = null;
StringBuffer optimizeString = null;
StringBuffer optimizeString = new StringBuffer();
if (fetch.getHint("openjpa.hint.optimize") != null) {
optimizeString = new StringBuffer();
rows = (Integer)fetch.getHint("openjpa.hint.optimize");
optimizeString.append(" ").append(optimizeClause).append(" ")
.append(rows).append(" ");
if(rows.intValue() > 1)
if (rows.intValue() > 1)
optimizeString.append(rowsClause).append(" ");
else
optimizeString.append(rowClause).append(" ");