[jOOQ/jOOQ#11157] Add support for COVAR_SAMP and COVAR_POP aggregate and window functions
This commit is contained in:
parent
37273114a5
commit
b4e498a014
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>ALTER DATABASE IF EXISTS</code> statement.
|
||||
* The <code>ALTER DATABASE</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "hiding", "unused" })
|
||||
final class AlterDatabaseImpl
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>ALTER DOMAIN IF EXISTS</code> statement.
|
||||
* The <code>ALTER DOMAIN</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "hiding", "rawtypes", "unchecked", "unused" })
|
||||
final class AlterDomainImpl<T>
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>ALTER SCHEMA IF EXISTS</code> statement.
|
||||
* The <code>ALTER SCHEMA</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "hiding", "unused" })
|
||||
final class AlterSchemaImpl
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>ALTER VIEW IF EXISTS</code> statement.
|
||||
* The <code>ALTER VIEW</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "hiding", "rawtypes", "unused" })
|
||||
final class AlterViewImpl
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>COMMENT ON COLUMN</code> statement.
|
||||
* The <code>COMMENT ON TABLE</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "hiding", "rawtypes", "unused" })
|
||||
final class CommentOnImpl
|
||||
|
||||
87
jOOQ/src/main/java/org/jooq/impl/CovarPop.java
Normal file
87
jOOQ/src/main/java/org/jooq/impl/CovarPop.java
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Other licenses:
|
||||
* -----------------------------------------------------------------------------
|
||||
* Commercial licenses for this work are available. These replace the above
|
||||
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
|
||||
* database integrations.
|
||||
*
|
||||
* For more information, please visit: http://www.jooq.org/licenses
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
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.*;
|
||||
import org.jooq.impl.*;
|
||||
import org.jooq.tools.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>COVAR POP</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
|
||||
final class CovarPop
|
||||
extends
|
||||
DefaultAggregateFunction<BigDecimal>
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
CovarPop(
|
||||
Field<? extends Number> y,
|
||||
Field<? extends Number> x
|
||||
) {
|
||||
super(
|
||||
false,
|
||||
N_COVAR_POP,
|
||||
NUMERIC,
|
||||
nullSafeNotNull(y, INTEGER),
|
||||
nullSafeNotNull(x, INTEGER)
|
||||
);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// XXX: QueryPart API
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
}
|
||||
87
jOOQ/src/main/java/org/jooq/impl/CovarSamp.java
Normal file
87
jOOQ/src/main/java/org/jooq/impl/CovarSamp.java
Normal file
@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
* Other licenses:
|
||||
* -----------------------------------------------------------------------------
|
||||
* Commercial licenses for this work are available. These replace the above
|
||||
* ASL 2.0 and offer limited warranties, support, maintenance, and commercial
|
||||
* database integrations.
|
||||
*
|
||||
* For more information, please visit: http://www.jooq.org/licenses
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
package org.jooq.impl;
|
||||
|
||||
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.*;
|
||||
import org.jooq.impl.*;
|
||||
import org.jooq.tools.*;
|
||||
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>COVAR SAMP</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
|
||||
final class CovarSamp
|
||||
extends
|
||||
DefaultAggregateFunction<BigDecimal>
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
CovarSamp(
|
||||
Field<? extends Number> y,
|
||||
Field<? extends Number> x
|
||||
) {
|
||||
super(
|
||||
false,
|
||||
N_COVAR_SAMP,
|
||||
NUMERIC,
|
||||
nullSafeNotNull(y, INTEGER),
|
||||
nullSafeNotNull(x, INTEGER)
|
||||
);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// XXX: QueryPart API
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>CREATE DATABASE IF NOT EXISTS</code> statement.
|
||||
* The <code>CREATE DATABASE</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "unused" })
|
||||
final class CreateDatabaseImpl
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>CREATE DOMAIN IF NOT EXISTS</code> statement.
|
||||
* The <code>CREATE DOMAIN</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "hiding", "rawtypes", "unchecked", "unused" })
|
||||
final class CreateDomainImpl<T>
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>CREATE SCHEMA IF NOT EXISTS</code> statement.
|
||||
* The <code>CREATE SCHEMA</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "unused" })
|
||||
final class CreateSchemaImpl
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>CREATE SEQUENCE IF NOT EXISTS</code> statement.
|
||||
* The <code>CREATE SEQUENCE</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "hiding", "rawtypes", "unchecked", "unused" })
|
||||
final class CreateSequenceImpl
|
||||
|
||||
@ -17292,6 +17292,24 @@ public class DSL {
|
||||
return new Xmlforest(fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <code>COVAR_SAMP</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ FIREBIRD, POSTGRES })
|
||||
public static AggregateFunction<BigDecimal> covarSamp(Field<? extends Number> y, Field<? extends Number> x) {
|
||||
return new CovarSamp(y, x);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <code>COVAR_POP</code> function.
|
||||
*/
|
||||
@NotNull
|
||||
@Support({ FIREBIRD, POSTGRES })
|
||||
public static AggregateFunction<BigDecimal> covarPop(Field<? extends Number> y, Field<? extends Number> x) {
|
||||
return new CovarPop(y, x);
|
||||
}
|
||||
|
||||
/**
|
||||
* The <code>MEDIAN</code> function.
|
||||
*/
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DROP DATABASE IF EXISTS</code> statement.
|
||||
* The <code>DROP DATABASE</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "unused" })
|
||||
final class DropDatabaseImpl
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DROP DOMAIN IF EXISTS</code> statement.
|
||||
* The <code>DROP DOMAIN</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unused" })
|
||||
final class DropDomainImpl
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DROP SCHEMA IF EXISTS</code> statement.
|
||||
* The <code>DROP SCHEMA</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "unused" })
|
||||
final class DropSchemaImpl
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>DROP SEQUENCE IF EXISTS</code> statement.
|
||||
* The <code>DROP SEQUENCE</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unused" })
|
||||
final class DropSequenceImpl
|
||||
|
||||
@ -55,7 +55,7 @@ import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>LOG</code> statement.
|
||||
* The <code>LN</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "rawtypes", "unchecked", "unused" })
|
||||
final class Log
|
||||
|
||||
@ -41,7 +41,6 @@ import static org.jooq.impl.DSL.name;
|
||||
import static org.jooq.impl.DSL.unquotedName;
|
||||
|
||||
import org.jooq.Name;
|
||||
import org.jooq.SQLDialect;
|
||||
|
||||
/**
|
||||
* An internal {@link Name} cache.
|
||||
@ -99,6 +98,8 @@ final class Names {
|
||||
static final Name N_COTH = unquotedName("coth");
|
||||
static final Name N_COUNT = unquotedName("count");
|
||||
static final Name N_COUNTSET = unquotedName("countset");
|
||||
static final Name N_COVAR_POP = unquotedName("covar_pop");
|
||||
static final Name N_COVAR_SAMP = unquotedName("covar_samp");
|
||||
static final Name N_CURRENTUSER = unquotedName("currentuser");
|
||||
static final Name N_CURRENT_BIGDATETIME = unquotedName("current_bigdatetime");
|
||||
static final Name N_CURRENT_CATALOG = unquotedName("current_catalog");
|
||||
|
||||
@ -54,7 +54,7 @@ import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
* The <code>REVOKE GRANT OPTION FOR</code> statement.
|
||||
* The <code>REVOKE</code> statement.
|
||||
*/
|
||||
@SuppressWarnings({ "hiding", "rawtypes", "unchecked", "unused" })
|
||||
final class RevokeImpl
|
||||
|
||||
Loading…
Reference in New Issue
Block a user