Replaced internal references to the deprecated Factory.literal() by

Factory.inline()
This commit is contained in:
Lukas Eder 2012-05-25 10:14:18 +02:00
parent 5c6638bd5c
commit 0d5850bc53
3 changed files with 10 additions and 12 deletions

View File

@ -38,7 +38,7 @@ package org.jooq.impl;
import static java.util.Arrays.asList;
import static org.jooq.SQLDialect.CUBRID;
import static org.jooq.SQLDialect.SQLSERVER;
import static org.jooq.impl.Factory.literal;
import static org.jooq.impl.Factory.inline;
import static org.jooq.impl.Factory.one;
import java.util.Arrays;
@ -778,7 +778,7 @@ implements
Field<?>[] fields = new Field[fieldIndexes.length];
for (int i = 0; i < fieldIndexes.length; i++) {
fields[i] = literal(fieldIndexes[i]);
fields[i] = inline(fieldIndexes[i]);
}
addOrderBy(fields);

View File

@ -4626,8 +4626,7 @@ public class Factory implements FactoryOperations {
*/
@Support({ CUBRID, ORACLE })
public static Field<String> sysConnectByPath(Field<?> field, String separator) {
String escaped = "'" + separator.replace("'", "''") + "'";
return function("sys_connect_by_path", String.class, field, literal(escaped));
return function("sys_connect_by_path", String.class, field, inline(separator));
}
/**
@ -4873,8 +4872,7 @@ public class Factory implements FactoryOperations {
*/
@Support({ CUBRID, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SYBASE })
public static OrderedAggregateFunction<String> listAgg(Field<?> field, String separator) {
Field<String> literal = literal("'" + separator.replace("'", "''") + "'");
return new Function<String>(Term.LIST_AGG, SQLDataType.VARCHAR, nullSafe(field), literal);
return new Function<String>(Term.LIST_AGG, SQLDataType.VARCHAR, nullSafe(field), inline(separator));
}
/**
@ -5038,7 +5036,7 @@ public class Factory implements FactoryOperations {
*/
@Support({ DB2, POSTGRES, ORACLE })
public static <T> WindowIgnoreNullsStep<T> lead(Field<T> field, int offset) {
return new Function<T>("lead", nullSafeDataType(field), nullSafe(field), literal(offset));
return new Function<T>("lead", nullSafeDataType(field), nullSafe(field), inline(offset));
}
/**
@ -5064,7 +5062,7 @@ public class Factory implements FactoryOperations {
*/
@Support({ DB2, POSTGRES, ORACLE })
public static <T> WindowIgnoreNullsStep<T> lead(Field<T> field, int offset, Field<T> defaultValue) {
return new Function<T>("lead", nullSafeDataType(field), nullSafe(field), literal(offset), nullSafe(defaultValue));
return new Function<T>("lead", nullSafeDataType(field), nullSafe(field), inline(offset), nullSafe(defaultValue));
}
/**
@ -5086,7 +5084,7 @@ public class Factory implements FactoryOperations {
*/
@Support({ DB2, POSTGRES, ORACLE })
public static <T> WindowIgnoreNullsStep<T> lag(Field<T> field, int offset) {
return new Function<T>("lag", nullSafeDataType(field), nullSafe(field), literal(offset));
return new Function<T>("lag", nullSafeDataType(field), nullSafe(field), inline(offset));
}
/**
@ -5112,7 +5110,7 @@ public class Factory implements FactoryOperations {
*/
@Support({ DB2, POSTGRES, ORACLE })
public static <T> WindowIgnoreNullsStep<T> lag(Field<T> field, int offset, Field<T> defaultValue) {
return new Function<T>("lag", nullSafeDataType(field), nullSafe(field), literal(offset), nullSafe(defaultValue));
return new Function<T>("lag", nullSafeDataType(field), nullSafe(field), inline(offset), nullSafe(defaultValue));
}
// -------------------------------------------------------------------------

View File

@ -36,7 +36,7 @@
package org.jooq.impl;
import static org.jooq.impl.Factory.function;
import static org.jooq.impl.Factory.literal;
import static org.jooq.impl.Factory.inline;
import org.jooq.Configuration;
import org.jooq.Field;
@ -67,7 +67,7 @@ class Substring extends AbstractFunction<String> {
return function(functionName,
SQLDataType.VARCHAR, getArguments()[0],
getArguments()[1],
literal(Integer.MAX_VALUE));
inline(Integer.MAX_VALUE));
}
// Default behaviour