[jOOQ/jOOQ#12425] Move SHL/SHR binary operators to API generator
This commit is contained in:
parent
7c1b93fe35
commit
ae165e78a6
@ -675,6 +675,58 @@ extends
|
||||
@Support
|
||||
<Z> SortField<Z> sort(Map<T, Z> sortMap);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* The <code>SHL</code> operator.
|
||||
* <p>
|
||||
* Left shift all bits in a number
|
||||
*
|
||||
* @param value The number whose bits to shift left.
|
||||
* @param count The number of bits to shift.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTE })
|
||||
Field<T> shl(Number count);
|
||||
|
||||
/**
|
||||
* The <code>SHL</code> operator.
|
||||
* <p>
|
||||
* Left shift all bits in a number
|
||||
*
|
||||
* @param value The number whose bits to shift left.
|
||||
* @param count The number of bits to shift.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTE })
|
||||
Field<T> shl(Field<? extends Number> count);
|
||||
|
||||
/**
|
||||
* The <code>SHR</code> operator.
|
||||
* <p>
|
||||
* Right shift all bits in a number
|
||||
*
|
||||
* @param value The number whose bits to shift right
|
||||
* @param count The number of bits to shift.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTE })
|
||||
Field<T> shr(Number count);
|
||||
|
||||
/**
|
||||
* The <code>SHR</code> operator.
|
||||
* <p>
|
||||
* Right shift all bits in a number
|
||||
*
|
||||
* @param value The number whose bits to shift right
|
||||
* @param count The number of bits to shift.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTE })
|
||||
Field<T> shr(Field<? extends Number> count);
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Arithmetic operations
|
||||
// ------------------------------------------------------------------------
|
||||
@ -1196,46 +1248,6 @@ extends
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTE })
|
||||
Field<T> bitXNor(Field<T> value);
|
||||
|
||||
/**
|
||||
* The bitwise left shift operator.
|
||||
*
|
||||
* @see DSL#shl(Field, Field)
|
||||
* @see DSL#power(Field, Number)
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTE })
|
||||
Field<T> shl(Number value);
|
||||
|
||||
/**
|
||||
* The bitwise left shift operator.
|
||||
*
|
||||
* @see DSL#shl(Field, Field)
|
||||
* @see DSL#power(Field, Number)
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTE })
|
||||
Field<T> shl(Field<? extends Number> value);
|
||||
|
||||
/**
|
||||
* The bitwise right shift operator.
|
||||
*
|
||||
* @see DSL#shr(Field, Field)
|
||||
* @see DSL#power(Field, Number)
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTE })
|
||||
Field<T> shr(Number value);
|
||||
|
||||
/**
|
||||
* The bitwise right shift operator.
|
||||
*
|
||||
* @see DSL#shr(Field, Field)
|
||||
* @see DSL#power(Field, Number)
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ CUBRID, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES, SQLITE, YUGABYTE })
|
||||
Field<T> shr(Field<? extends Number> value);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// XML predicates
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@ -337,6 +337,34 @@ abstract class AbstractField<T> extends AbstractTypedNamed<T> implements Field<T
|
||||
return new SortFieldImpl<>(new ConstantSortField<>((Field) this), SortOrder.DEFAULT);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public final Field<T> shl(Number count) {
|
||||
return DSL.shl((Field) this, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public final Field<T> shl(Field<? extends Number> count) {
|
||||
return DSL.shl((Field) this, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public final Field<T> shr(Number count) {
|
||||
return DSL.shr((Field) this, count);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public final Field<T> shr(Field<? extends Number> count) {
|
||||
return DSL.shr((Field) this, count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// XXX: Arithmetic operations
|
||||
// ------------------------------------------------------------------------
|
||||
@ -574,38 +602,6 @@ abstract class AbstractField<T> extends AbstractTypedNamed<T> implements Field<T
|
||||
return DSL.bitXNor((Field) this, (Field) value);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public final Field<T> shl(Number value) {
|
||||
// Workaround assignment for https://bugs.eclipse.org/bugs/show_bug.cgi?id=473657
|
||||
final Field result = DSL.shl((Field) this, (Field) Tools.field(value));
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public final Field<T> shl(Field<? extends Number> value) {
|
||||
// Workaround assignment for https://bugs.eclipse.org/bugs/show_bug.cgi?id=473657
|
||||
final Field result = DSL.shl((Field) this, value);
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public final Field<T> shr(Number value) {
|
||||
// Workaround assignment for https://bugs.eclipse.org/bugs/show_bug.cgi?id=473657
|
||||
final Field result = DSL.shr((Field) this, (Field) Tools.field(value));
|
||||
return result;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public final Field<T> shr(Field<? extends Number> value) {
|
||||
// Workaround assignment for https://bugs.eclipse.org/bugs/show_bug.cgi?id=473657
|
||||
final Field result = DSL.shr((Field) this, (Field) value);
|
||||
return result;
|
||||
}
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// XXX: Conditions created from this field
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
@ -41,7 +41,6 @@ import static org.jooq.DatePart.MONTH;
|
||||
import static org.jooq.DatePart.SECOND;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.CUBRID;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.DERBY;
|
||||
@ -52,7 +51,6 @@ import static org.jooq.SQLDialect.HSQLDB;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
// ...
|
||||
// ...
|
||||
@ -61,13 +59,11 @@ import static org.jooq.SQLDialect.SQLITE;
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.YUGABYTE;
|
||||
import static org.jooq.impl.DSL.function;
|
||||
import static org.jooq.impl.DSL.inline;
|
||||
import static org.jooq.impl.DSL.inlined;
|
||||
import static org.jooq.impl.DSL.keyword;
|
||||
import static org.jooq.impl.DSL.two;
|
||||
import static org.jooq.impl.DSL.val;
|
||||
import static org.jooq.impl.ExpressionOperator.ADD;
|
||||
import static org.jooq.impl.ExpressionOperator.BIT_AND;
|
||||
@ -79,8 +75,6 @@ import static org.jooq.impl.ExpressionOperator.BIT_XOR;
|
||||
import static org.jooq.impl.ExpressionOperator.MULTIPLY;
|
||||
import static org.jooq.impl.ExpressionOperator.SUBTRACT;
|
||||
import static org.jooq.impl.Internal.iadd;
|
||||
import static org.jooq.impl.Internal.idiv;
|
||||
import static org.jooq.impl.Internal.imul;
|
||||
import static org.jooq.impl.Internal.isub;
|
||||
import static org.jooq.impl.Keywords.K_AS;
|
||||
import static org.jooq.impl.Keywords.K_CAST;
|
||||
@ -100,20 +94,12 @@ import static org.jooq.impl.Names.N_ADD_MONTHS;
|
||||
import static org.jooq.impl.Names.N_ADD_SECONDS;
|
||||
import static org.jooq.impl.Names.N_BIN_AND;
|
||||
import static org.jooq.impl.Names.N_BIN_OR;
|
||||
import static org.jooq.impl.Names.N_BIN_SHL;
|
||||
import static org.jooq.impl.Names.N_BIN_SHR;
|
||||
import static org.jooq.impl.Names.N_BIN_XOR;
|
||||
import static org.jooq.impl.Names.N_BITAND;
|
||||
import static org.jooq.impl.Names.N_BITOR;
|
||||
import static org.jooq.impl.Names.N_BITSHIFTLEFT;
|
||||
import static org.jooq.impl.Names.N_BITSHIFTRIGHT;
|
||||
import static org.jooq.impl.Names.N_BITXOR;
|
||||
import static org.jooq.impl.Names.N_DATEADD;
|
||||
import static org.jooq.impl.Names.N_DATE_ADD;
|
||||
import static org.jooq.impl.Names.N_LSHIFT;
|
||||
import static org.jooq.impl.Names.N_RSHIFT;
|
||||
import static org.jooq.impl.Names.N_SHIFTLEFT;
|
||||
import static org.jooq.impl.Names.N_SHIFTRIGHT;
|
||||
import static org.jooq.impl.Names.N_SQL_TSI_FRAC_SECOND;
|
||||
import static org.jooq.impl.Names.N_SQL_TSI_MILLI_SECOND;
|
||||
import static org.jooq.impl.Names.N_SQL_TSI_MONTH;
|
||||
@ -187,7 +173,6 @@ final class Expression<T> extends AbstractTransformable<T> {
|
||||
return lt;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
final void accept0(Context<?> ctx) {
|
||||
SQLDialect family = ctx.family();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user