[#6093] Add Field.pow[er](Field)
This commit is contained in:
parent
c2db4f46c3
commit
413cfae257
@ -780,6 +780,46 @@ public interface Field<T> extends SelectField<T>, GroupField, FieldOrRow {
|
||||
@Support
|
||||
Field<T> modulo(Field<? extends Number> value);
|
||||
|
||||
/**
|
||||
* An arithmetic expression getting this value raised to the power of <code>exponent</code>.
|
||||
* <p>
|
||||
* This renders the power operation where available:
|
||||
* <code><pre>[this] ^ [value]</pre></code> ... or the power function
|
||||
* elsewhere: <code><pre>power([this], [value])</pre></code>
|
||||
*
|
||||
* @see DSL#power(Field, Number)
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
Field<BigDecimal> pow(Number exponent);
|
||||
|
||||
/**
|
||||
* An arithmetic expression getting this value raised to the power of <code>exponent</code>.
|
||||
* <p>
|
||||
* This renders the power operation where available:
|
||||
* <code><pre>[this] ^ [value]</pre></code> ... or the power function
|
||||
* elsewhere: <code><pre>power([this], [value])</pre></code>
|
||||
*
|
||||
* @see DSL#power(Field, Field)
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
Field<BigDecimal> pow(Field<? extends Number> exponent);
|
||||
|
||||
/**
|
||||
* An alias for {@link #power(Number)}.
|
||||
*
|
||||
* @see #power(Number)
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
Field<BigDecimal> power(Number exponent);
|
||||
|
||||
/**
|
||||
* An alias for {@link #power(Field)}.
|
||||
*
|
||||
* @see #power(Field)
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
Field<BigDecimal> power(Field<? extends Number> exponent);
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// Bitwise operations
|
||||
// ------------------------------------------------------------------------
|
||||
@ -2513,24 +2553,6 @@ public interface Field<T> extends SelectField<T>, GroupField, FieldOrRow {
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
Field<BigDecimal> log(int base);
|
||||
|
||||
/**
|
||||
* This method is part of the pre-2.0 API. This API is maintained for
|
||||
* backwards-compatibility. It may be removed in the future. Consider using
|
||||
* equivalent methods from {@link DSLContext}
|
||||
*
|
||||
* @see DSL#power(Field, Number)
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
Field<BigDecimal> pow(Number exponent);
|
||||
|
||||
/**
|
||||
* An alias for {@link #power(Number)}.
|
||||
*
|
||||
* @see #power(Number)
|
||||
*/
|
||||
@Support({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, MARIADB, MYSQL, POSTGRES })
|
||||
Field<BigDecimal> power(Number exponent);
|
||||
|
||||
/**
|
||||
* This method is part of the pre-2.0 API. This API is maintained for
|
||||
* backwards-compatibility. It may be removed in the future. Consider using
|
||||
|
||||
@ -1460,11 +1460,20 @@ abstract class AbstractField<T> extends AbstractQueryPart implements Field<T> {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public final Field<BigDecimal> power(Number exponent) {
|
||||
return pow(exponent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Field<BigDecimal> pow(Field<? extends Number> exponent) {
|
||||
return DSL.power(numeric(), exponent);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Field<BigDecimal> power(Field<? extends Number> exponent) {
|
||||
return pow(exponent);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated
|
||||
public final Field<BigDecimal> acos() {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user