[jOOQ/jOOQ#11061] [jOOQ/jOOQ#11070] [jOOQ/jOOQ#11091] SPACE
This commit is contained in:
parent
16bee574ef
commit
72c85e4ed7
@ -15613,6 +15613,24 @@ public class DSL {
|
||||
return new Sign(number);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <code>SPACE</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> space(Number count) {
|
||||
return new Space(Tools.field(count));
|
||||
}
|
||||
|
||||
/**
|
||||
* The <code>SPACE</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> space(Field<? extends Number> count) {
|
||||
return new Space(count);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <code>SUBSTRING</code> function.
|
||||
*/
|
||||
@ -15889,36 +15907,6 @@ public class DSL {
|
||||
return lpad(field, length, Character.toString(character));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the SQL Server specific <code>SPACE()</code> function.
|
||||
* <p>
|
||||
* This function can be emulated using {@link #repeat(String, int)} in
|
||||
* dialects that do not ship with a native <code>SPACE()</code> function.
|
||||
*
|
||||
* @see <a
|
||||
* href="http://technet.microsoft.com/en-us/library/ms187950.aspx">http://technet.microsoft.com/en-us/library/ms187950.aspx</a>
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> space(int value) {
|
||||
return space(Tools.field(value));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the SQL Server specific <code>SPACE()</code> function.
|
||||
* <p>
|
||||
* This function can be emulated using {@link #repeat(String, int)} in
|
||||
* dialects that do not ship with a native <code>SPACE()</code> function.
|
||||
*
|
||||
* @see <a
|
||||
* href="http://technet.microsoft.com/en-us/library/ms187950.aspx">http://technet.microsoft.com/en-us/library/ms187950.aspx</a>
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE })
|
||||
public static Field<String> space(Field<Integer> value) {
|
||||
return new Space(value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convenience method for {@link #replace(Field, String, String)} to escape
|
||||
* data for use with {@link Field#like(Field, char)}.
|
||||
|
||||
@ -37,29 +37,47 @@
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
import static org.jooq.impl.Names.N_SPACE;
|
||||
import static org.jooq.impl.SQLDataType.INTEGER;
|
||||
import static org.jooq.impl.SQLDataType.VARCHAR;
|
||||
import static org.jooq.impl.Tools.nullSafeNotNull;
|
||||
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.*;
|
||||
|
||||
final class Space extends AbstractField<String> {
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* Generated UID
|
||||
*/
|
||||
private static final long serialVersionUID = -4239524454814412161L;
|
||||
/**
|
||||
* The <code>SPACE</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
|
||||
final class Space
|
||||
extends
|
||||
AbstractField<String>
|
||||
{
|
||||
|
||||
private final Field<Integer> count;
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
Space(Field<Integer> count) {
|
||||
super(N_SPACE, VARCHAR.nullable(count == null || count.getDataType().nullable()));
|
||||
private final Field<? extends Number> count;
|
||||
|
||||
Space(
|
||||
Field<? extends Number> count
|
||||
) {
|
||||
super(N_SPACE, allNotNull(VARCHAR, count));
|
||||
|
||||
this.count = nullSafeNotNull(count, INTEGER);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// XXX: QueryPart API
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public final void accept(Context<?> ctx) {
|
||||
switch (ctx.family()) {
|
||||
@ -111,4 +129,5 @@ final class Space extends AbstractField<String> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user