[jOOQ/jOOQ#11061] [jOOQ/jOOQ#11070] [jOOQ/jOOQ#11091] UPPER / LOWER
This commit is contained in:
parent
eb2bd7719d
commit
df2f737a7f
@ -14935,13 +14935,31 @@ public class DSL {
|
||||
return new Left(string, length);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <code>LOWER</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support
|
||||
public static Field<String> lower(String string) {
|
||||
return new Lower(Tools.field(string));
|
||||
}
|
||||
|
||||
/**
|
||||
* The <code>LOWER</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support
|
||||
public static Field<String> lower(Field<String> string) {
|
||||
return new Lower(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <code>LTRIM</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> ltrim(String string, String characters) {
|
||||
return new LTrim(Tools.field(string), Tools.field(characters));
|
||||
return new Ltrim(Tools.field(string), Tools.field(characters));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -14950,7 +14968,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support({ DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> ltrim(String string, Field<String> characters) {
|
||||
return new LTrim(Tools.field(string), characters);
|
||||
return new Ltrim(Tools.field(string), characters);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -14959,7 +14977,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support({ DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> ltrim(Field<String> string, String characters) {
|
||||
return new LTrim(string, Tools.field(characters));
|
||||
return new Ltrim(string, Tools.field(characters));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -14968,7 +14986,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support({ DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> ltrim(Field<String> string, Field<String> characters) {
|
||||
return new LTrim(string, characters);
|
||||
return new Ltrim(string, characters);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -14977,7 +14995,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support
|
||||
public static Field<String> ltrim(String string) {
|
||||
return new LTrim(Tools.field(string));
|
||||
return new Ltrim(Tools.field(string));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -14986,7 +15004,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support
|
||||
public static Field<String> ltrim(Field<String> string) {
|
||||
return new LTrim(string);
|
||||
return new Ltrim(string);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -15085,7 +15103,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support({ DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> rtrim(String string, String characters) {
|
||||
return new RTrim(Tools.field(string), Tools.field(characters));
|
||||
return new Rtrim(Tools.field(string), Tools.field(characters));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -15094,7 +15112,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support({ DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> rtrim(String string, Field<String> characters) {
|
||||
return new RTrim(Tools.field(string), characters);
|
||||
return new Rtrim(Tools.field(string), characters);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -15103,7 +15121,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support({ DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> rtrim(Field<String> string, String characters) {
|
||||
return new RTrim(string, Tools.field(characters));
|
||||
return new Rtrim(string, Tools.field(characters));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -15112,7 +15130,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support({ DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> rtrim(Field<String> string, Field<String> characters) {
|
||||
return new RTrim(string, characters);
|
||||
return new Rtrim(string, characters);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -15121,7 +15139,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support
|
||||
public static Field<String> rtrim(String string) {
|
||||
return new RTrim(Tools.field(string));
|
||||
return new Rtrim(Tools.field(string));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -15130,7 +15148,7 @@ public class DSL {
|
||||
@NotNull
|
||||
@Support
|
||||
public static Field<String> rtrim(Field<String> string) {
|
||||
return new RTrim(string);
|
||||
return new Rtrim(string);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -15313,53 +15331,25 @@ public class DSL {
|
||||
return new Trim(string);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get the upper(field) function.
|
||||
*
|
||||
* @see #upper(Field)
|
||||
* The <code>UPPER</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support
|
||||
public static Field<String> upper(String value) {
|
||||
return upper(Tools.field(value));
|
||||
public static Field<String> upper(String string) {
|
||||
return new Upper(Tools.field(string));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the upper(field) function.
|
||||
* <p>
|
||||
* This renders the upper function in all dialects:
|
||||
* <code><pre>upper([field])</pre></code>
|
||||
* The <code>UPPER</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support
|
||||
public static Field<String> upper(Field<String> field) {
|
||||
return new Upper(Tools.nullSafe(field));
|
||||
public static Field<String> upper(Field<String> string) {
|
||||
return new Upper(string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the lower(field) function.
|
||||
*
|
||||
* @see #lower(Field)
|
||||
*/
|
||||
@NotNull
|
||||
@Support
|
||||
public static Field<String> lower(String value) {
|
||||
return lower(Tools.field(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the lower(field) function.
|
||||
* <p>
|
||||
* This renders the lower function in all dialects:
|
||||
* <code><pre>lower([field])</pre></code>
|
||||
*/
|
||||
@NotNull
|
||||
@Support
|
||||
public static Field<String> lower(Field<String> field) {
|
||||
return new Lower(Tools.nullSafe(field));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the rpad(field, length) function.
|
||||
|
||||
@ -55,7 +55,7 @@ import java.util.*;
|
||||
* The <code>LTRIM</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
|
||||
final class LTrim
|
||||
final class Ltrim
|
||||
extends
|
||||
AbstractField<String>
|
||||
{
|
||||
@ -65,7 +65,7 @@ extends
|
||||
private final Field<String> string;
|
||||
private final Field<String> characters;
|
||||
|
||||
LTrim(
|
||||
Ltrim(
|
||||
Field string
|
||||
) {
|
||||
super(N_LTRIM, allNotNull(VARCHAR, string));
|
||||
@ -74,7 +74,7 @@ extends
|
||||
this.characters = null;
|
||||
}
|
||||
|
||||
LTrim(
|
||||
Ltrim(
|
||||
Field string,
|
||||
Field characters
|
||||
) {
|
||||
|
||||
@ -37,29 +37,47 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Names.N_LCASE;
|
||||
import static org.jooq.impl.Names.N_LOWER;
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Internal.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.*;
|
||||
import org.jooq.impl.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
* The <code>LOWER</code> statement.
|
||||
*/
|
||||
final class Lower extends AbstractField<String> {
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
|
||||
final class Lower
|
||||
extends
|
||||
AbstractField<String>
|
||||
{
|
||||
|
||||
/**
|
||||
* Generated UID
|
||||
*/
|
||||
private static final long serialVersionUID = -9070564546827153434L;
|
||||
private final Field<String> field;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
Lower(Field<String> field) {
|
||||
super(N_LOWER, field.getDataType());
|
||||
private final Field<String> string;
|
||||
|
||||
this.field = field;
|
||||
Lower(
|
||||
Field string
|
||||
) {
|
||||
super(N_LOWER, allNotNull(VARCHAR, string));
|
||||
|
||||
this.string = nullSafeNotNull(string, VARCHAR);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// XXX: QueryPart API
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
switch (ctx.family()) {
|
||||
@ -70,8 +88,10 @@ final class Lower extends AbstractField<String> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(N_LOWER).sql('(').visit(field).sql(')');
|
||||
ctx.visit(N_LOWER).sql('(').visit(string).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -55,7 +55,7 @@ import java.util.*;
|
||||
* The <code>RTRIM</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
|
||||
final class RTrim
|
||||
final class Rtrim
|
||||
extends
|
||||
AbstractField<String>
|
||||
{
|
||||
@ -65,7 +65,7 @@ extends
|
||||
private final Field<String> string;
|
||||
private final Field<String> characters;
|
||||
|
||||
RTrim(
|
||||
Rtrim(
|
||||
Field string
|
||||
) {
|
||||
super(N_RTRIM, allNotNull(VARCHAR, string));
|
||||
@ -74,7 +74,7 @@ extends
|
||||
this.characters = null;
|
||||
}
|
||||
|
||||
RTrim(
|
||||
Rtrim(
|
||||
Field string,
|
||||
Field characters
|
||||
) {
|
||||
|
||||
@ -37,29 +37,47 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Names.N_UCASE;
|
||||
import static org.jooq.impl.Names.N_UPPER;
|
||||
import static org.jooq.impl.DSL.*;
|
||||
import static org.jooq.impl.Internal.*;
|
||||
import static org.jooq.impl.Keywords.*;
|
||||
import static org.jooq.impl.Names.*;
|
||||
import static org.jooq.impl.SQLDataType.*;
|
||||
import static org.jooq.impl.Tools.*;
|
||||
import static org.jooq.impl.Tools.BooleanDataKey.*;
|
||||
import static org.jooq.SQLDialect.*;
|
||||
|
||||
import org.jooq.Context;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.*;
|
||||
import org.jooq.impl.*;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* @author Lukas Eder
|
||||
* The <code>UPPER</code> statement.
|
||||
*/
|
||||
final class Upper extends AbstractField<String> {
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
|
||||
final class Upper
|
||||
extends
|
||||
AbstractField<String>
|
||||
{
|
||||
|
||||
/**
|
||||
* Generated UID
|
||||
*/
|
||||
private static final long serialVersionUID = -9070564546827153434L;
|
||||
private final Field<String> field;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
Upper(Field<String> field) {
|
||||
super(N_UPPER, field.getDataType());
|
||||
private final Field<String> string;
|
||||
|
||||
this.field = field;
|
||||
Upper(
|
||||
Field string
|
||||
) {
|
||||
super(N_UPPER, allNotNull(VARCHAR, string));
|
||||
|
||||
this.string = nullSafeNotNull(string, VARCHAR);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// XXX: QueryPart API
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
switch (ctx.family()) {
|
||||
@ -70,8 +88,10 @@ final class Upper extends AbstractField<String> {
|
||||
|
||||
|
||||
default:
|
||||
ctx.visit(N_UPPER).sql('(').visit(field).sql(')');
|
||||
ctx.visit(N_UPPER).sql('(').visit(string).sql(')');
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user