Resolved javac compilation problem

This commit is contained in:
Lukas Eder 2011-10-18 19:57:01 +00:00
parent 2703c18fbb
commit 05d6b89177
5 changed files with 22 additions and 20 deletions

View File

@ -234,7 +234,7 @@ implements
if (!forUpdateOf.isEmpty()) {
context.sql(" of ");
forUpdateOf.toSQLNames(context);
JooqUtil.toSQLNames(context, forUpdateOf);
}
else if (!forUpdateOfTables.isEmpty()) {
context.sql(" of ");
@ -253,7 +253,7 @@ implements
// Render the OF [table-names] clause
default:
forUpdateOfTables.toSQLNames(context);
JooqUtil.toSQLNames(context, forUpdateOfTables);
break;
}
}

View File

@ -43,6 +43,7 @@ import org.jooq.AliasProvider;
import org.jooq.Attachable;
import org.jooq.BindContext;
import org.jooq.RenderContext;
import org.jooq.Table;
/**
* @author Lukas Eder
@ -112,10 +113,10 @@ class AliasProviderImpl<T extends AliasProvider<T>> extends AbstractNamedQueryPa
case HSQLDB:
case POSTGRES: {
if (context.declareTables() && aliasProvider instanceof ArrayTable) {
ArrayTable<?> table = (ArrayTable<?>) aliasProvider;
Table<?> table = (Table<?>) aliasProvider;
context.sql("(");
table.getFields().toSQLNames(context);
JooqUtil.toSQLNames(context, table.getFields());
context.sql(")");
}

View File

@ -145,7 +145,7 @@ class Join extends AbstractQueryPart {
private void toSQL0(RenderContext context) {
if (usingSyntax) {
context.sql(" using (");
using.toSQLNames(context);
JooqUtil.toSQLNames(context, using);
context.sql(")");
}
else {

View File

@ -40,6 +40,7 @@ import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import javax.persistence.Column;
@ -49,6 +50,7 @@ import org.jooq.Configuration;
import org.jooq.Cursor;
import org.jooq.Field;
import org.jooq.FieldProvider;
import org.jooq.NamedQueryPart;
import org.jooq.Record;
import org.jooq.RenderContext;
import org.jooq.Table;
@ -181,6 +183,20 @@ final class JooqUtil {
context.sql(")");
}
/**
* Render a list of names of the <code>NamedQueryParts</code> contained in
* this list.
*/
static void toSQLNames(RenderContext context, Collection<? extends NamedQueryPart> list) {
String separator = "";
for (NamedQueryPart part : list) {
context.sql(separator).literal(part.getName());
separator = ", ";
}
}
/**
* Combine a field with an array of fields
*/

View File

@ -38,7 +38,6 @@ package org.jooq.impl;
import java.util.Collection;
import org.jooq.NamedQueryPart;
import org.jooq.RenderContext;
/**
* @author Lukas Eder
@ -57,18 +56,4 @@ class NamedQueryPartList<T extends NamedQueryPart> extends QueryPartList<T> {
NamedQueryPartList(Collection<? extends T> wrappedList) {
super(wrappedList);
}
/**
* Render a list of names of the <code>NamedQueryParts</code> contained in
* this list.
*/
final void toSQLNames(RenderContext context) {
String separator = "";
for (NamedQueryPart part : this) {
context.sql(separator).literal(part.getName());
separator = ", ";
}
}
}