diff --git a/jOOQ-test/src/org/jooq/test/jOOQAbstractTest.java b/jOOQ-test/src/org/jooq/test/jOOQAbstractTest.java index 202f59bdfb..7c7bfe7cb8 100644 --- a/jOOQ-test/src/org/jooq/test/jOOQAbstractTest.java +++ b/jOOQ-test/src/org/jooq/test/jOOQAbstractTest.java @@ -1515,13 +1515,14 @@ public abstract class jOOQAbstractTest< @Test public void testLiterals() throws Exception { - Record record = create().select(zero(), one(), two(), pi(), e()).fetchOne(); + Record record = create().select(zero(), one(), two(), pi(), e(), rad(deg(pi()))).fetchOne(); assertEquals(0, record.getValue(0)); assertEquals(1, record.getValue(1)); assertEquals(2, record.getValue(2)); assertEquals("3.141", record.getValueAsString(3).substring(0, 5)); assertEquals("2.718", record.getValueAsString(4).substring(0, 5)); + assertEquals("3.141", record.getValueAsString(5).substring(0, 5)); } @Test @@ -6382,6 +6383,12 @@ public abstract class jOOQAbstractTest< assertEquals("abc", create().select(trim("abc ")).fetchOne(0)); assertEquals("abc", create().select(trim(" abc")).fetchOne(0)); assertEquals("abc", create().select(trim(" abc ")).fetchOne(0)); + assertEquals(" abc", create().select(rtrim(" abc ")).fetchOne(0)); + assertEquals("abc ", create().select(ltrim(" abc ")).fetchOne(0)); + + // Lower / Upper + assertEquals("abc", create().select(lower("ABC")).fetchOne(0)); + assertEquals("ABC", create().select(upper("abc")).fetchOne(0)); // String concatenation assertEquals("abc", create().select(concat("a", "b", "c")).fetchOne(0)); diff --git a/jOOQ/src/main/java/org/jooq/FactoryOperations.java b/jOOQ/src/main/java/org/jooq/FactoryOperations.java index 8db528c569..0a4ef4e1b2 100644 --- a/jOOQ/src/main/java/org/jooq/FactoryOperations.java +++ b/jOOQ/src/main/java/org/jooq/FactoryOperations.java @@ -603,6 +603,7 @@ public interface FactoryOperations extends Configuration { * Note, this statement is only supported in DSL mode. Immediate execution * is omitted for future extensibility of this command. */ + @Support > Truncate truncate(Table table); // ------------------------------------------------------------------------- @@ -695,6 +696,7 @@ public interface FactoryOperations extends Configuration { * * @throws DataAccessException if something went wrong executing the query */ + @Support({ DB2, DERBY, H2, HSQLDB, MYSQL, SYBASE, ORACLE, POSTGRES }) int use(Schema schema) throws DataAccessException; /** @@ -703,6 +705,7 @@ public interface FactoryOperations extends Configuration { * @see #use(Schema) * @throws DataAccessException if something went wrong executing the query */ + @Support({ DB2, DERBY, H2, HSQLDB, MYSQL, SYBASE, ORACLE, POSTGRES }) int use(String schema) throws DataAccessException; // ------------------------------------------------------------------------- diff --git a/jOOQ/src/main/java/org/jooq/Field.java b/jOOQ/src/main/java/org/jooq/Field.java index c90a619e47..20612ac0b6 100644 --- a/jOOQ/src/main/java/org/jooq/Field.java +++ b/jOOQ/src/main/java/org/jooq/Field.java @@ -36,6 +36,19 @@ package org.jooq; +import static org.jooq.SQLDialect.ASE; +import static org.jooq.SQLDialect.DB2; +import static org.jooq.SQLDialect.DERBY; +import static org.jooq.SQLDialect.H2; +import static org.jooq.SQLDialect.HSQLDB; +import static org.jooq.SQLDialect.INGRES; +import static org.jooq.SQLDialect.MYSQL; +import static org.jooq.SQLDialect.ORACLE; +import static org.jooq.SQLDialect.POSTGRES; +import static org.jooq.SQLDialect.SQLITE; +import static org.jooq.SQLDialect.SQLSERVER; +import static org.jooq.SQLDialect.SYBASE; + import java.math.BigDecimal; import java.util.Collection; import java.util.Map; @@ -116,6 +129,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider Field cast(Field field); /** @@ -124,6 +138,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider The generic type of the cast field * @param type */ + @Support Field cast(DataType type); /** @@ -138,6 +153,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider Field cast(Class type); // ------------------------------------------------------------------------ @@ -149,6 +165,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider asc(); /** @@ -156,6 +173,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider desc(); /** @@ -175,6 +193,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider sortAsc(Collection sortList); /** @@ -194,6 +213,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider sortAsc(T... sortList); /** @@ -213,6 +233,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider sortDesc(Collection sortList); /** @@ -232,6 +253,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider sortDesc(T... sortList); /** @@ -251,6 +273,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider SortField sort(Map sortMap); // ------------------------------------------------------------------------ @@ -263,6 +286,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider
-[this]
*/ + @Support Field neg(); /** @@ -273,11 +297,13 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProviderIf this is a date time field, then [value] days are added to this date * */ + @Support Field add(Number value); /** * An arithmetic expression adding this to value */ + @Support Field add(Field value); /** @@ -290,31 +316,37 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider * */ + @Support Field sub(Number value); /** * An arithmetic expression subtracting value from this */ + @Support Field sub(Field value); /** * An arithmetic expression multiplying this with value */ + @Support Field mul(Number value); /** * An arithmetic expression multiplying this with value */ + @Support Field mul(Field value); /** * An arithmetic expression dividing this by value */ + @Support Field div(Number value); /** * An arithmetic expression dividing this by value */ + @Support Field div(Field value); /** @@ -325,6 +357,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider
mod([this], [value])
*/ + @Support Field mod(Number value); /** @@ -335,6 +368,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider
mod([this], [value])
*/ + @Support Field mod(Field value); // ------------------------------------------------------------------------ @@ -344,271 +378,333 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProviderthis is null */ + @Support Condition isNull(); /** * this is not null */ + @Support Condition isNotNull(); /** * lcase(this) in ("1", "y", "yes", "true", "on", "enabled") */ + @Support Condition isTrue(); /** * lcase(this) in ("0", "n", "no", "false", "off", "disabled") */ + @Support Condition isFalse(); /** * this like value */ + @Support Condition like(Field value); /** * this like value */ + @Support Condition like(T value); /** * this not like value */ + @Support Condition notLike(Field value); /** * this not like value */ + @Support Condition notLike(T value); /** * this in (values...) */ + @Support Condition in(Collection values); /** * this in (values...) */ + @Support Condition in(T... values); /** * this in (values...) */ + @Support Condition in(Field... values); /** * this in (select...) */ + @Support Condition in(Select query); /** * this not in (values...) */ + @Support Condition notIn(Collection values); /** * this not in (values...) */ + @Support Condition notIn(T... values); /** * this not in (values...) */ + @Support Condition notIn(Field... values); /** * this not in (select...) */ + @Support Condition notIn(Select query); /** * this between minValue and maxValue */ + @Support Condition between(T minValue, T maxValue); /** * this between minValue and maxValue */ + @Support Condition between(Field minValue, Field maxValue); /** * this = value + *

+ * If value == null, then this will return a condition + * equivalent to {@link #isNull()} for convenience. SQL's ternary + * NULL logic is rarely of use for Java programmers. */ + @Support Condition equal(T value); /** * this = field */ + @Support Condition equal(Field field); /** * this = (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition equal(Select query); /** * this = any (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition equalAny(Select query); /** * this = some (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition equalSome(Select query); /** * this = all (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition equalAll(Select query); /** * this != value + *

+ * If value == null, then this will return a condition + * equivalent to {@link #isNotNull()} for convenience. SQL's ternary + * NULL logic is rarely of use for Java programmers. */ + @Support Condition notEqual(T value); /** * this != field */ + @Support Condition notEqual(Field field); /** * this != (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition notEqual(Select query); /** * this != any (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition notEqualAny(Select query); /** * this != some (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition notEqualSome(Select query); /** * this != all (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition notEqualAll(Select query); /** * this < value */ + @Support Condition lessThan(T value); /** * this < field */ + @Support Condition lessThan(Field field); /** * this < (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition lessThan(Select query); /** * this < any (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition lessThanAny(Select query); /** * this < some (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition lessThanSome(Select query); /** * this < all (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition lessThanAll(Select query); /** * this <= value */ + @Support Condition lessOrEqual(T value); /** * this <= field */ + @Support Condition lessOrEqual(Field field); /** * this <= (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition lessOrEqual(Select query); /** * this <= any (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition lessOrEqualAny(Select query); /** * this <= some (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition lessOrEqualSome(Select query); /** * this <= all (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition lessOrEqualAll(Select query); /** * this > value */ + @Support Condition greaterThan(T value); /** * this > field */ + @Support Condition greaterThan(Field field); /** * this > (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition greaterThan(Select query); /** * this > any (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition greaterThanAny(Select query); /** * this > some (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition greaterThanSome(Select query); /** * this > all (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition greaterThanAll(Select query); /** * this >= value */ + @Support Condition greaterOrEqual(T value); /** * this >= field */ + @Support Condition greaterOrEqual(Field field); /** * this >= (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition greaterOrEqual(Select query); /** * this >= any (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition greaterOrEqualAny(Select query); /** * this >= some (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition greaterOrEqualSome(Select query); /** * this >= all (Select ...) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) Condition greaterOrEqualAll(Select query); // ------------------------------------------------------------------------ @@ -624,6 +720,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider sign(); /** @@ -633,6 +730,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider abs(); /** @@ -642,6 +740,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider round(); /** @@ -651,6 +750,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider round(int decimals); /** @@ -660,6 +760,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider floor(); /** @@ -669,6 +770,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider ceil(); /** @@ -678,6 +780,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider sqrt(); /** @@ -687,6 +790,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider exp(); /** @@ -696,6 +800,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider ln(); /** @@ -705,6 +810,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider log(int base); /** @@ -714,6 +820,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider power(Number exponent); /** @@ -723,6 +830,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider acos(); /** @@ -732,6 +840,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider asin(); /** @@ -741,6 +850,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider atan(); /** @@ -750,6 +860,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider atan2(Number y); /** @@ -759,6 +870,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider atan2(Field y); /** @@ -768,6 +880,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider cos(); /** @@ -777,6 +890,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider sin(); /** @@ -786,6 +900,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider tan(); /** @@ -795,6 +910,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider cot(); /** @@ -804,6 +920,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider sinh(); /** @@ -813,6 +930,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider cosh(); /** @@ -822,6 +940,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider tanh(); /** @@ -831,6 +950,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider coth(); /** @@ -840,6 +960,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider deg(); /** @@ -849,6 +970,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider rad(); /** @@ -858,6 +980,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider count(); /** @@ -867,6 +990,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider countDistinct(); /** @@ -876,6 +1000,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider max(); /** @@ -885,6 +1010,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider min(); /** @@ -894,6 +1020,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider sum(); /** @@ -903,6 +1030,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider avg(); /** @@ -912,6 +1040,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider median(); /** @@ -921,6 +1050,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider stddevPop(); /** @@ -930,6 +1060,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider stddevSamp(); /** @@ -939,6 +1070,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider varPop(); /** @@ -948,6 +1080,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider varSamp(); /** @@ -958,6 +1091,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider countOver(); /** @@ -968,6 +1102,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider maxOver(); /** @@ -978,6 +1113,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider minOver(); /** @@ -988,6 +1124,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider sumOver(); /** @@ -998,6 +1135,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider avgOver(); /** @@ -1008,6 +1146,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider firstValue(); /** @@ -1018,6 +1157,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lastValue(); /** @@ -1028,6 +1168,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lead(); /** @@ -1038,6 +1179,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lead(int offset); /** @@ -1048,6 +1190,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lead(int offset, T defaultValue); /** @@ -1058,6 +1201,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lead(int offset, Field defaultValue); /** @@ -1068,6 +1212,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lag(); /** @@ -1078,6 +1223,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lag(int offset); /** @@ -1088,6 +1234,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lag(int offset, T defaultValue); /** @@ -1098,6 +1245,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lag(int offset, Field defaultValue); /** @@ -1108,6 +1256,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider stddevPopOver(); /** @@ -1118,6 +1267,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider stddevSampOver(); /** @@ -1128,6 +1278,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider varPopOver(); /** @@ -1138,6 +1289,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider varSampOver(); /** @@ -1147,6 +1299,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider upper(); /** @@ -1156,6 +1309,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lower(); /** @@ -1165,6 +1319,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider trim(); /** @@ -1174,6 +1329,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider rtrim(); /** @@ -1183,6 +1339,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider ltrim(); /** @@ -1192,6 +1349,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider rpad(Field length); /** @@ -1201,6 +1359,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider rpad(int length); /** @@ -1210,6 +1369,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider rpad(Field length, Field character); /** @@ -1219,6 +1379,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider rpad(int length, char character); /** @@ -1228,6 +1389,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lpad(Field length); /** @@ -1237,6 +1399,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lpad(int length); /** @@ -1246,6 +1409,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lpad(Field length, Field character); /** @@ -1255,6 +1419,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider lpad(int length, char character); /** @@ -1264,6 +1429,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider repeat(Number count); /** @@ -1273,6 +1439,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider repeat(Field count); /** @@ -1282,6 +1449,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider replace(Field search); /** @@ -1291,6 +1459,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider replace(String search); /** @@ -1300,6 +1469,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider replace(Field search, Field replace); /** @@ -1309,6 +1479,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider replace(String search, String replace); /** @@ -1318,6 +1489,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider position(String search); /** @@ -1327,6 +1499,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider position(Field search); /** @@ -1336,6 +1509,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider ascii(); /** @@ -1345,6 +1519,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider concat(Field... fields); /** @@ -1354,6 +1529,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider concat(String... values); /** @@ -1363,6 +1539,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider substring(int startingPosition); /** @@ -1372,6 +1549,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider substring(Field startingPosition); /** @@ -1381,6 +1559,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider substring(int startingPosition, int length); /** @@ -1390,6 +1569,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider substring(Field startingPosition, Field length); /** @@ -1399,6 +1579,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider length(); /** @@ -1408,6 +1589,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider charLength(); /** @@ -1417,6 +1599,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider bitLength(); /** @@ -1426,6 +1609,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider octetLength(); /** @@ -1435,6 +1619,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider extract(DatePart datePart); /** @@ -1444,6 +1629,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider greatest(T... others); /** @@ -1453,6 +1639,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider greatest(Field... others); /** @@ -1462,6 +1649,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider least(T... others); /** @@ -1471,6 +1659,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider least(Field... others); /** @@ -1480,6 +1669,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider nvl(T defaultValue); /** @@ -1489,6 +1679,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider nvl(Field defaultValue); /** @@ -1498,6 +1689,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider Field nvl2(Z valueIfNotNull, Z valueIfNull); /** @@ -1507,6 +1699,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider Field nvl2(Field valueIfNotNull, Field valueIfNull); /** @@ -1516,6 +1709,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider nullif(T other); /** @@ -1525,6 +1719,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider nullif(Field other); /** @@ -1534,6 +1729,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider Field decode(T search, Z result); /** @@ -1543,6 +1739,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider Field decode(T search, Z result, Object... more); /** @@ -1552,6 +1749,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider Field decode(Field search, Field result); /** @@ -1561,6 +1759,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider Field decode(Field search, Field result, Field... more); /** @@ -1570,6 +1769,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider coalesce(T option, T... options); /** @@ -1579,6 +1779,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider coalesce(Field option, Field... options); } diff --git a/jOOQ/src/main/java/org/jooq/impl/Factory.java b/jOOQ/src/main/java/org/jooq/impl/Factory.java index 2e8517e48a..3637717d23 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Factory.java +++ b/jOOQ/src/main/java/org/jooq/impl/Factory.java @@ -36,6 +36,18 @@ package org.jooq.impl; +import static org.jooq.SQLDialect.ASE; +import static org.jooq.SQLDialect.DB2; +import static org.jooq.SQLDialect.DERBY; +import static org.jooq.SQLDialect.H2; +import static org.jooq.SQLDialect.HSQLDB; +import static org.jooq.SQLDialect.INGRES; +import static org.jooq.SQLDialect.MYSQL; +import static org.jooq.SQLDialect.ORACLE; +import static org.jooq.SQLDialect.POSTGRES; +import static org.jooq.SQLDialect.SQLITE; +import static org.jooq.SQLDialect.SQLSERVER; +import static org.jooq.SQLDialect.SYBASE; import static org.jooq.impl.Util.combine; import java.io.IOException; @@ -94,6 +106,7 @@ import org.jooq.SelectSelectStep; import org.jooq.Sequence; import org.jooq.SimpleSelectQuery; import org.jooq.SimpleSelectWhereStep; +import org.jooq.Support; import org.jooq.Table; import org.jooq.TableLike; import org.jooq.TableRecord; @@ -325,6 +338,7 @@ public class Factory implements FactoryOperations { * * @see #unnest(List) */ + @Support({ H2, HSQLDB, POSTGRES, ORACLE }) public static Table table(List list) { return table(list.toArray()); } @@ -334,6 +348,7 @@ public class Factory implements FactoryOperations { * * @see #unnest(Object[]) */ + @Support({ H2, HSQLDB, POSTGRES, ORACLE }) public static Table table(Object[] array) { return table(val(array)); } @@ -343,6 +358,7 @@ public class Factory implements FactoryOperations { * * @see #unnest(ArrayRecord) */ + @Support(ORACLE) public static Table table(ArrayRecord array) { return table(val(array)); } @@ -352,6 +368,7 @@ public class Factory implements FactoryOperations { * * @see #unnest(Field) */ + @Support({ H2, HSQLDB, POSTGRES, ORACLE }) public static Table table(Field cursor) { return unnest(cursor); } @@ -365,6 +382,7 @@ public class Factory implements FactoryOperations { * For Oracle, use {@link #table(ArrayRecord)} instead, as Oracle knows only * typed arrays */ + @Support({ H2, HSQLDB, POSTGRES, ORACLE }) public static Table unnest(List list) { return table(list.toArray()); } @@ -378,6 +396,7 @@ public class Factory implements FactoryOperations { * For Oracle, use {@link #table(ArrayRecord)} instead, as Oracle knows only * typed arrays */ + @Support({ H2, HSQLDB, POSTGRES, ORACLE }) public static Table unnest(Object[] array) { return table(val(array)); } @@ -388,6 +407,7 @@ public class Factory implements FactoryOperations { * This wraps the argument array in a TABLE function for * Oracle. Currently, only Oracle knows typed arrays */ + @Support(ORACLE) public static Table unnest(ArrayRecord array) { return table(val(array)); } @@ -409,6 +429,7 @@ public class Factory implements FactoryOperations { * involved with stored functions can only be of type Object[]. * Such arrays are converted into VARCHAR arrays by jOOQ. */ + @Support({ H2, HSQLDB, POSTGRES, ORACLE }) public static Table unnest(Field cursor) { if (cursor == null) { throw new IllegalArgumentException(); @@ -467,6 +488,7 @@ public class Factory implements FactoryOperations { * @param sql The SQL * @return A table wrapping the plain SQL */ + @Support public static Table table(String sql) { return table(sql, new Object[0]); } @@ -498,6 +520,7 @@ public class Factory implements FactoryOperations { * @param sql The SQL * @return A table wrapping the plain SQL */ + @Support public static Table table(String sql, Object... bindings) { return new SQLTable(sql, bindings); } @@ -522,6 +545,7 @@ public class Factory implements FactoryOperations { * @param sql The SQL * @return A field wrapping the plain SQL */ + @Support public static Field field(String sql) { return field(sql, new Object[0]); } @@ -547,6 +571,7 @@ public class Factory implements FactoryOperations { * @param bindings The bindings for the field * @return A field wrapping the plain SQL */ + @Support public static Field field(String sql, Object... bindings) { return field(sql, Object.class, bindings); } @@ -572,6 +597,7 @@ public class Factory implements FactoryOperations { * @param type The field type * @return A field wrapping the plain SQL */ + @Support public static Field field(String sql, Class type) { return field(sql, type, new Object[0]); } @@ -598,6 +624,7 @@ public class Factory implements FactoryOperations { * @param bindings The bindings for the field * @return A field wrapping the plain SQL */ + @Support public static Field field(String sql, Class type, Object... bindings) { return field(sql, getDataType(type), bindings); } @@ -623,6 +650,7 @@ public class Factory implements FactoryOperations { * @param type The field type * @return A field wrapping the plain SQL */ + @Support public static Field field(String sql, DataType type) { return field(sql, type, new Object[0]); } @@ -649,6 +677,7 @@ public class Factory implements FactoryOperations { * @param bindings The bindings for the field * @return A field wrapping the plain SQL */ + @Support public static Field field(String sql, DataType type, Object... bindings) { return new SQLField(sql, type, bindings); } @@ -662,6 +691,7 @@ public class Factory implements FactoryOperations { * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! */ + @Support public static Field function(String name, Class type, Field... arguments) { return function(name, getDataType(type), nullSafe(arguments)); } @@ -675,6 +705,7 @@ public class Factory implements FactoryOperations { * malicious SQL injection. Be sure to properly use bind variables and/or * escape literals when concatenated into SQL clauses! */ + @Support public static Field function(String name, DataType type, Field... arguments) { return new Function(name, type, nullSafe(arguments)); } @@ -696,6 +727,7 @@ public class Factory implements FactoryOperations { * @param sql The SQL * @return A condition wrapping the plain SQL */ + @Support public static Condition condition(String sql) { return condition(sql, new Object[0]); } @@ -719,6 +751,7 @@ public class Factory implements FactoryOperations { * @param bindings The bindings * @return A condition wrapping the plain SQL */ + @Support public static Condition condition(String sql, Object... bindings) { return new SQLCondition(sql, bindings); } @@ -817,6 +850,7 @@ public class Factory implements FactoryOperations { /** * Return a Condition that will always evaluate to true */ + @Support public static Condition trueCondition() { return new TrueCondition(); } @@ -824,6 +858,7 @@ public class Factory implements FactoryOperations { /** * Return a Condition that will always evaluate to false */ + @Support public static Condition falseCondition() { return new FalseCondition(); } @@ -833,6 +868,7 @@ public class Factory implements FactoryOperations { *

* EXISTS ([query]) */ + @Support public static Condition exists(Select query) { return new SelectQueryAsExistsCondition(query, ExistsOperator.EXISTS); } @@ -842,6 +878,7 @@ public class Factory implements FactoryOperations { *

* NOT EXISTS ([query]) */ + @Support public static Condition notExists(Select query) { return new SelectQueryAsExistsCondition(query, ExistsOperator.NOT_EXISTS); } @@ -1111,7 +1148,6 @@ public class Factory implements FactoryOperations { public final int use(Schema schema) { int result = 0; - // SQL Server does not support such a syntax try { String schemaName = render(schema); @@ -1135,6 +1171,14 @@ public class Factory implements FactoryOperations { case POSTGRES: result = query("set search_path = " + schemaName).execute(); break; + + // SQL Server do not support such a syntax + case SQLSERVER: + break; + + // SQLite doesn't have any schemata + case SQLITE: + break; } } finally { @@ -1192,6 +1236,7 @@ public class Factory implements FactoryOperations { * * @see Case */ + @Support public static Case decode() { return new CaseImpl(); } @@ -1203,6 +1248,7 @@ public class Factory implements FactoryOperations { * * @see #decode(Field, Field, Field, Field[]) */ + @Support public static Field decode(T value, T search, Z result) { return decode(value, search, result, new Object[0]); } @@ -1214,6 +1260,7 @@ public class Factory implements FactoryOperations { * * @see #decode(Field, Field, Field, Field[]) */ + @Support public static Field decode(T value, T search, Z result, Object... more) { return decode(val(value), val(search), val(result), vals(more).toArray(new Field[0])); } @@ -1225,6 +1272,7 @@ public class Factory implements FactoryOperations { * * @see #decode(Field, Field, Field, Field[]) */ + @Support public static Field decode(Field value, Field search, Field result) { return decode(nullSafe(value), nullSafe(search), nullSafe(result), new Field[0]); } @@ -1255,6 +1303,7 @@ public class Factory implements FactoryOperations { * If more.length is odd, then it is assumed that it * contains more search/result pairs plus a default at the end. * */ + @Support public static Field decode(Field value, Field search, Field result, Field... more) { return new Decode(nullSafe(value), nullSafe(search), nullSafe(result), nullSafe(more)); } @@ -1267,6 +1316,7 @@ public class Factory implements FactoryOperations { * @param as The field whose type is used for the cast * @return The cast field */ + @Support public static Field cast(Object value, Field as) { return val(value).cast(as); } @@ -1278,6 +1328,7 @@ public class Factory implements FactoryOperations { * @param as The field whose type is used for the cast * @return The cast field */ + @Support public static Field castNull(Field as) { return NULL().cast(as); } @@ -1290,6 +1341,7 @@ public class Factory implements FactoryOperations { * @param type The type that is used for the cast * @return The cast field */ + @Support public static Field cast(Object value, Class type) { return val(value).cast(type); } @@ -1301,6 +1353,7 @@ public class Factory implements FactoryOperations { * @param type The type that is used for the cast * @return The cast field */ + @Support public static Field castNull(DataType type) { return NULL().cast(type); } @@ -1313,6 +1366,7 @@ public class Factory implements FactoryOperations { * @param type The type that is used for the cast * @return The cast field */ + @Support public static Field cast(Object value, DataType type) { return val(value).cast(type); } @@ -1324,6 +1378,7 @@ public class Factory implements FactoryOperations { * @param type The type that is used for the cast * @return The cast field */ + @Support public static Field castNull(Class type) { return NULL().cast(type); } @@ -1353,6 +1408,7 @@ public class Factory implements FactoryOperations { * * @see #coalesce(Field, Field...) */ + @Support public static Field coalesce(T value, T... values) { return coalesce(val(value), vals(values).toArray(new Field[0])); } @@ -1368,6 +1424,7 @@ public class Factory implements FactoryOperations { * * */ + @Support public static Field coalesce(Field field, Field... fields) { return function("coalesce", nullSafeDataType(field), nullSafe(combine(field, fields))); } @@ -1377,6 +1434,7 @@ public class Factory implements FactoryOperations { * * @see #nvl(Field, Field) */ + @Support public static Field nvl(T value, T defaultValue) { return nvl(val(value), val(defaultValue)); } @@ -1386,6 +1444,7 @@ public class Factory implements FactoryOperations { * * @see #nvl(Field, Field) */ + @Support public static Field nvl(T value, Field defaultValue) { return nvl(val(value), nullSafe(defaultValue)); } @@ -1395,6 +1454,7 @@ public class Factory implements FactoryOperations { * * @see #nvl(Field, Field) */ + @Support public static Field nvl(Field value, T defaultValue) { return nvl(nullSafe(value), val(defaultValue)); } @@ -1427,6 +1487,7 @@ public class Factory implements FactoryOperations { * href="http://www.sqlite.org/lang_corefunc.html#ifnull">IFNULL * */ + @Support public static Field nvl(Field value, Field defaultValue) { return new Nvl(nullSafe(value), nullSafe(defaultValue)); } @@ -1436,6 +1497,7 @@ public class Factory implements FactoryOperations { * * @see #nvl2(Field, Field, Field) */ + @Support public static Field nvl2(Field value, Z valueIfNotNull, Z valueIfNull) { return nvl2(nullSafe(value), val(valueIfNotNull), val(valueIfNull)); } @@ -1445,6 +1507,7 @@ public class Factory implements FactoryOperations { * * @see #nvl2(Field, Field, Field) */ + @Support public static Field nvl2(Field value, Z valueIfNotNull, Field valueIfNull) { return nvl2(nullSafe(value), val(valueIfNotNull), nullSafe(valueIfNull)); } @@ -1454,6 +1517,7 @@ public class Factory implements FactoryOperations { * * @see #nvl2(Field, Field, Field) */ + @Support public static Field nvl2(Field value, Field valueIfNotNull, Z valueIfNull) { return nvl2(nullSafe(value), nullSafe(valueIfNotNull), val(valueIfNull)); } @@ -1470,6 +1534,7 @@ public class Factory implements FactoryOperations { * Other dialects: * CASE WHEN [value] IS NULL THEN [valueIfNull] ELSE [valueIfNotNull] END */ + @Support public static Field nvl2(Field value, Field valueIfNotNull, Field valueIfNull) { return new Nvl2(nullSafe(value), nullSafe(valueIfNotNull), nullSafe(valueIfNull)); } @@ -1479,6 +1544,7 @@ public class Factory implements FactoryOperations { * * @see #nullif(Field, Field) */ + @Support public static Field nullif(T value, T other) { return nullif(val(value), val(other)); } @@ -1488,6 +1554,7 @@ public class Factory implements FactoryOperations { * * @see #nullif(Field, Field) */ + @Support public static Field nullif(T value, Field other) { return nullif(val(value), nullSafe(other)); } @@ -1497,6 +1564,7 @@ public class Factory implements FactoryOperations { * * @see #nullif(Field, Field) */ + @Support public static Field nullif(Field value, T other) { return nullif(nullSafe(value), val(other)); } @@ -1511,6 +1579,7 @@ public class Factory implements FactoryOperations { * *

*/ + @Support public static Field nullif(Field value, Field other) { return function("nullif", nullSafeDataType(value), nullSafe(value), nullSafe(other)); } @@ -1524,6 +1593,7 @@ public class Factory implements FactoryOperations { * * @see #upper(Field) */ + @Support public static Field upper(String value) { return upper(val(value)); } @@ -1534,6 +1604,7 @@ public class Factory implements FactoryOperations { * This renders the upper function in all dialects: *

upper([field])
*/ + @Support public static Field upper(Field field) { return function("upper", SQLDataType.VARCHAR, nullSafe(field)); } @@ -1543,6 +1614,7 @@ public class Factory implements FactoryOperations { * * @see #lower(Field) */ + @Support public static Field lower(String value) { return lower(val(value)); } @@ -1553,6 +1625,7 @@ public class Factory implements FactoryOperations { * This renders the lower function in all dialects: *
lower([field])
*/ + @Support public static Field lower(Field value) { return function("lower", SQLDataType.VARCHAR, nullSafe(value)); } @@ -1562,6 +1635,7 @@ public class Factory implements FactoryOperations { * * @see #trim(Field) */ + @Support public static Field trim(String value) { return trim(val(value)); } @@ -1573,6 +1647,7 @@ public class Factory implements FactoryOperations { *
trim([field])
... or simulates it elsewhere using * rtrim and ltrim:
ltrim(rtrim([field]))
*/ + @Support public static Field trim(Field field) { return new Trim(nullSafe(field)); } @@ -1582,6 +1657,7 @@ public class Factory implements FactoryOperations { * * @see #rtrim(Field) */ + @Support public static Field rtrim(String value) { return rtrim(val(value)); } @@ -1592,6 +1668,7 @@ public class Factory implements FactoryOperations { * This renders the rtrim function in all dialects: *
rtrim([field])
*/ + @Support public static Field rtrim(Field field) { return function("rtrim", SQLDataType.VARCHAR, nullSafe(field)); } @@ -1601,6 +1678,7 @@ public class Factory implements FactoryOperations { * * @see #ltrim(Field) */ + @Support public static Field ltrim(String value) { return ltrim(val(value)); } @@ -1611,6 +1689,7 @@ public class Factory implements FactoryOperations { * This renders the ltrim function in all dialects: *
ltrim([field])
*/ + @Support public static Field ltrim(Field value) { return function("ltrim", SQLDataType.VARCHAR, nullSafe(value)); } @@ -1620,6 +1699,7 @@ public class Factory implements FactoryOperations { * * @see #rpad(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field rpad(Field field, int length) { return rpad(nullSafe(field), val(length)); } @@ -1633,6 +1713,7 @@ public class Factory implements FactoryOperations { * well, depending on the RDBMS: *
concat([field], repeat(' ', [length] - length([field])))
*/ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field rpad(Field field, Field length) { return new Rpad(nullSafe(field), nullSafe(length)); } @@ -1642,6 +1723,7 @@ public class Factory implements FactoryOperations { * * @see #rpad(Field, Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field rpad(Field field, int length, char character) { return rpad(field, length, Character.toString(character)); } @@ -1651,6 +1733,7 @@ public class Factory implements FactoryOperations { * * @see #rpad(Field, Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field rpad(Field field, int length, String character) { return rpad(nullSafe(field), val(length), val(character)); } @@ -1664,6 +1747,7 @@ public class Factory implements FactoryOperations { * well, depending on the RDBMS: *
concat([field], repeat([character], [length] - length([field])))
*/ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field rpad(Field field, Field length, Field character) { return new Rpad(nullSafe(field), nullSafe(length), nullSafe(character)); } @@ -1673,6 +1757,7 @@ public class Factory implements FactoryOperations { * * @see #lpad(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field lpad(Field field, int length) { return lpad(nullSafe(field), val(length)); } @@ -1686,6 +1771,7 @@ public class Factory implements FactoryOperations { * well, depending on the RDBMS: *
concat(repeat(' ', [length] - length([field])), [field])
*/ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field lpad(Field field, Field length) { return new Lpad(nullSafe(field), nullSafe(length)); } @@ -1695,6 +1781,7 @@ public class Factory implements FactoryOperations { * * @see #lpad(Field, Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field lpad(Field field, int length, char character) { return lpad(field, length, Character.toString(character)); } @@ -1704,6 +1791,7 @@ public class Factory implements FactoryOperations { * * @see #lpad(Field, Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field lpad(Field field, int length, String character) { return lpad(nullSafe(field), val(length), val(character)); } @@ -1717,6 +1805,7 @@ public class Factory implements FactoryOperations { * well, depending on the RDBMS: *
concat(repeat([character], [length] - length([field])), [field])
*/ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field lpad(Field field, Field length, Field character) { return new Lpad(nullSafe(field), nullSafe(length), nullSafe(character)); } @@ -1726,6 +1815,7 @@ public class Factory implements FactoryOperations { * * @see #repeat(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field repeat(String field, int count) { return repeat(val(field), val(count)); } @@ -1735,6 +1825,7 @@ public class Factory implements FactoryOperations { * * @see #repeat(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field repeat(String field, Field count) { return repeat(val(field), nullSafe(count)); } @@ -1744,6 +1835,7 @@ public class Factory implements FactoryOperations { * * @see #repeat(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field repeat(Field field, int count) { return repeat(nullSafe(field), val(count)); } @@ -1758,6 +1850,7 @@ public class Factory implements FactoryOperations { * RDBMS: *
rpad([field], length([field]) * [count], [field])
*/ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field repeat(Field field, Field count) { return new Repeat(nullSafe(field), nullSafe(count)); } @@ -1767,6 +1860,7 @@ public class Factory implements FactoryOperations { * * @see #replace(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field replace(Field field, String search) { return replace(nullSafe(field), val(search)); } @@ -1780,6 +1874,7 @@ public class Factory implements FactoryOperations { * using the three-argument replace function: *
replace([field], [search], '')
*/ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field replace(Field field, Field search) { return new Replace(nullSafe(field), nullSafe(search)); } @@ -1789,6 +1884,7 @@ public class Factory implements FactoryOperations { * * @see #replace(Field, Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field replace(Field field, String search, String replace) { return replace(nullSafe(field), val(search), val(replace)); } @@ -1800,6 +1896,7 @@ public class Factory implements FactoryOperations { *
replace([field], [search]) or
      * str_replace([field], [search])
*/ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field replace(Field field, Field search, Field replace) { return new Replace(nullSafe(field), nullSafe(search), nullSafe(replace)); } @@ -1809,6 +1906,7 @@ public class Factory implements FactoryOperations { * * @see #position(Field, Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field position(String in, String search) { return position(val(in), val(search)); } @@ -1818,6 +1916,7 @@ public class Factory implements FactoryOperations { * * @see #position(Field, Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field position(String in, Field search) { return position(val(in), nullSafe(search)); } @@ -1827,6 +1926,7 @@ public class Factory implements FactoryOperations { * * @see #position(Field, Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field position(Field in, String search) { return position(nullSafe(in), val(search)); } @@ -1841,6 +1941,7 @@ public class Factory implements FactoryOperations { * instr([in], [search]) or * charindex([search], [in]) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field position(Field in, Field search) { return new Position(nullSafe(search), nullSafe(in)); } @@ -1850,6 +1951,7 @@ public class Factory implements FactoryOperations { * * @see #ascii(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field ascii(String field) { return ascii(val(field)); } @@ -1860,6 +1962,7 @@ public class Factory implements FactoryOperations { * This renders the ascii function: *
ascii([field])
*/ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field ascii(Field field) { return new Ascii(nullSafe(field)); } @@ -1869,6 +1972,7 @@ public class Factory implements FactoryOperations { * * @see #concat(Field...) */ + @Support public static Field concat(String... values) { return concat(vals((Object[]) values).toArray(new Field[0])); } @@ -1883,6 +1987,7 @@ public class Factory implements FactoryOperations { * If any of the given fields is not a {@link String} field, they are cast * to Field<String> first using {@link #cast(Object, Class)} */ + @Support public static Field concat(Field... fields) { return new Concat(nullSafe(fields)); } @@ -1892,6 +1997,7 @@ public class Factory implements FactoryOperations { * * @see #substring(Field, Field) */ + @Support public static Field substring(Field field, int startingPosition) { return substring(nullSafe(field), val(startingPosition)); } @@ -1903,6 +2009,7 @@ public class Factory implements FactoryOperations { *
substr([field], [startingPosition]) or
      * substring([field], [startingPosition])
*/ + @Support public static Field substring(Field field, Field startingPosition) { return new Substring(nullSafe(field), nullSafe(startingPosition)); } @@ -1912,6 +2019,7 @@ public class Factory implements FactoryOperations { * * @see #substring(Field, Field, Field) */ + @Support public static Field substring(Field field, int startingPosition, int length) { return substring(nullSafe(field), val(startingPosition), val(length)); } @@ -1923,6 +2031,7 @@ public class Factory implements FactoryOperations { *
substr([field], [startingPosition], [length]) or
      * substring([field], [startingPosition], [length])
*/ + @Support public static Field substring(Field field, Field startingPosition, Field length) { return new Substring(nullSafe(field), nullSafe(startingPosition), nullSafe(length)); } @@ -1933,6 +2042,7 @@ public class Factory implements FactoryOperations { * * @see #charLength(String) */ + @Support public static Field length(String value) { return length(val(value)); } @@ -1943,6 +2053,7 @@ public class Factory implements FactoryOperations { * * @see #charLength(Field) */ + @Support public static Field length(Field field) { return charLength(field); } @@ -1952,6 +2063,7 @@ public class Factory implements FactoryOperations { *

* This translates into any dialect */ + @Support public static Field charLength(String value) { return charLength(val(value)); } @@ -1961,6 +2073,7 @@ public class Factory implements FactoryOperations { *

* This translates into any dialect */ + @Support public static Field charLength(Field field) { return new Function(Term.CHAR_LENGTH, SQLDataType.INTEGER, nullSafe(field)); } @@ -1970,6 +2083,7 @@ public class Factory implements FactoryOperations { *

* This translates into any dialect */ + @Support public static Field bitLength(String value) { return bitLength(val(value)); } @@ -1979,6 +2093,7 @@ public class Factory implements FactoryOperations { *

* This translates into any dialect */ + @Support public static Field bitLength(Field field) { return new Function(Term.BIT_LENGTH, SQLDataType.INTEGER, nullSafe(field)); } @@ -1988,6 +2103,7 @@ public class Factory implements FactoryOperations { *

* This translates into any dialect */ + @Support public static Field octetLength(String value) { return octetLength(val(value)); } @@ -1997,6 +2113,7 @@ public class Factory implements FactoryOperations { *

* This translates into any dialect */ + @Support public static Field octetLength(Field field) { return new Function(Term.OCTET_LENGTH, SQLDataType.INTEGER, nullSafe(field)); } @@ -2010,6 +2127,7 @@ public class Factory implements FactoryOperations { *

* This translates into any dialect */ + @Support public static Field extract(java.util.Date value, DatePart datePart) { return extract(val(value), datePart); } @@ -2019,6 +2137,7 @@ public class Factory implements FactoryOperations { *

* This translates into any dialect */ + @Support public static Field extract(Field field, DatePart datePart) { return new Extract(nullSafe(field), datePart); } @@ -2049,6 +2168,7 @@ public class Factory implements FactoryOperations { * function * @return A field to be used in a GROUP BY clause */ + @Support({ DB2, MYSQL, ORACLE, SQLSERVER, SYBASE }) public static Field rollup(Field... fields) { return new Rollup(nullSafe(fields)); } @@ -2074,6 +2194,7 @@ public class Factory implements FactoryOperations { * function * @return A field to be used in a GROUP BY clause */ + @Support({ DB2, ORACLE, SQLSERVER, SYBASE }) public static Field cube(Field... fields) { return function("cube", Object.class, nullSafe(fields)); } @@ -2101,6 +2222,7 @@ public class Factory implements FactoryOperations { * @return A field to be used in a GROUP BY clause */ @SuppressWarnings("unchecked") + @Support({ DB2, ORACLE, SQLSERVER, SYBASE }) public static Field groupingSets(Field... fields) { List>[] array = new List[fields.length]; @@ -2134,6 +2256,7 @@ public class Factory implements FactoryOperations { * @return A field to be used in a GROUP BY clause */ @SuppressWarnings("unchecked") + @Support({ DB2, ORACLE, SQLSERVER, SYBASE }) public static Field groupingSets(Field[]... fieldSets) { List>[] array = new List[fieldSets.length]; @@ -2166,6 +2289,7 @@ public class Factory implements FactoryOperations { * function * @return A field to be used in a GROUP BY clause */ + @Support({ DB2, ORACLE, SQLSERVER, SYBASE }) public static Field groupingSets(Collection>... fieldSets) { WrappedList[] array = new WrappedList[fieldSets.length]; @@ -2194,6 +2318,7 @@ public class Factory implements FactoryOperations { * @see #cube(Field...) * @see #rollup(Field...) */ + @Support({ DB2, ORACLE, SQLSERVER, SYBASE }) public static Field grouping(Field field) { return function("grouping", Integer.class, nullSafe(field)); } @@ -2214,6 +2339,7 @@ public class Factory implements FactoryOperations { * @see #cube(Field...) * @see #rollup(Field...) */ + @Support({ ORACLE, SQLSERVER}) public static Field groupingId(Field... fields) { return function("grouping_id", Integer.class, nullSafe(fields)); } @@ -2228,6 +2354,7 @@ public class Factory implements FactoryOperations { * * @see #bitCount(Field) */ + @Support({ H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SYBASE, SQLITE }) public static Field bitCount(Number value) { return bitCount(val(value)); } @@ -2249,6 +2376,7 @@ public class Factory implements FactoryOperations { *

* More efficient algorithms are very welcome */ + @Support({ H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SYBASE, SQLITE }) public static Field bitCount(Field field) { return new BitCount(nullSafe(field)); } @@ -2258,6 +2386,7 @@ public class Factory implements FactoryOperations { * * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitNot(T value) { return bitNot(val(value)); } @@ -2268,6 +2397,7 @@ public class Factory implements FactoryOperations { * Most dialects natively support this using ~[field]. jOOQ * simulates this operator in some dialects using -[field] - 1 */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitNot(Field field) { return new Neg(nullSafe(field), ExpressionOperator.BIT_NOT); } @@ -2277,6 +2407,7 @@ public class Factory implements FactoryOperations { * * @see #bitAnd(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitAnd(T value1, T value2) { return bitAnd(val(value1), val(value2)); } @@ -2286,6 +2417,7 @@ public class Factory implements FactoryOperations { * * @see #bitAnd(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitAnd(T value1, Field value2) { return bitAnd(val(value1), nullSafe(value2)); } @@ -2295,6 +2427,7 @@ public class Factory implements FactoryOperations { * * @see #bitAnd(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitAnd(Field value1, T value2) { return bitAnd(nullSafe(value1), val(value2)); } @@ -2309,6 +2442,7 @@ public class Factory implements FactoryOperations { * ... or the and function elsewhere: *

bitand([field1], [field2])
*/ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitAnd(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_AND, nullSafe(field1), nullSafe(field2)); } @@ -2319,6 +2453,7 @@ public class Factory implements FactoryOperations { * @see #bitNand(Field, Field) * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitNand(T value1, T value2) { return bitNand(val(value1), val(value2)); } @@ -2329,6 +2464,7 @@ public class Factory implements FactoryOperations { * @see #bitNand(Field, Field) * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitNand(T value1, Field value2) { return bitNand(val(value1), nullSafe(value2)); } @@ -2339,6 +2475,7 @@ public class Factory implements FactoryOperations { * @see #bitNand(Field, Field) * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitNand(Field value1, T value2) { return bitNand(nullSafe(value1), val(value2)); } @@ -2355,6 +2492,7 @@ public class Factory implements FactoryOperations { * * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitNand(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_NAND, nullSafe(field1), nullSafe(field2)); } @@ -2364,6 +2502,7 @@ public class Factory implements FactoryOperations { * * @see #bitOr(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitOr(T value1, T value2) { return bitOr(val(value1), val(value2)); } @@ -2373,6 +2512,7 @@ public class Factory implements FactoryOperations { * * @see #bitOr(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitOr(T value1, Field value2) { return bitOr(val(value1), nullSafe(value2)); } @@ -2382,6 +2522,7 @@ public class Factory implements FactoryOperations { * * @see #bitOr(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitOr(Field value1, T value2) { return bitOr(nullSafe(value1), val(value2)); } @@ -2396,6 +2537,7 @@ public class Factory implements FactoryOperations { * ... or the or function elsewhere: *
bitor([field1], [field2])
*/ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitOr(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_OR, nullSafe(field1), nullSafe(field2)); } @@ -2406,6 +2548,7 @@ public class Factory implements FactoryOperations { * @see #bitNor(Field, Field) * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitNor(T value1, T value2) { return bitNor(val(value1), val(value2)); } @@ -2415,6 +2558,7 @@ public class Factory implements FactoryOperations { * @see #bitNor(Field, Field) * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitNor(T value1, Field value2) { return bitNor(val(value1), nullSafe(value2)); } @@ -2424,6 +2568,7 @@ public class Factory implements FactoryOperations { * @see #bitNor(Field, Field) * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitNor(Field value1, T value2) { return bitNor(nullSafe(value1), val(value2)); } @@ -2440,6 +2585,7 @@ public class Factory implements FactoryOperations { * * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitNor(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_NOR, nullSafe(field1), nullSafe(field2)); } @@ -2449,6 +2595,7 @@ public class Factory implements FactoryOperations { * * @see #bitXor(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitXor(T value1, T value2) { return bitXor(val(value1), val(value2)); } @@ -2458,6 +2605,7 @@ public class Factory implements FactoryOperations { * * @see #bitXor(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitXor(T value1, Field value2) { return bitXor(val(value1), nullSafe(value2)); } @@ -2467,6 +2615,7 @@ public class Factory implements FactoryOperations { * * @see #bitXor(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitXor(Field value1, T value2) { return bitXor(nullSafe(value1), val(value2)); } @@ -2481,6 +2630,7 @@ public class Factory implements FactoryOperations { * ... or the xor function elsewhere: *
bitxor([field1], [field2])
*/ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitXor(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_XOR, nullSafe(field1), nullSafe(field2)); } @@ -2491,6 +2641,7 @@ public class Factory implements FactoryOperations { * @see #bitXNor(Field, Field) * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitXNor(T value1, T value2) { return bitXNor(val(value1), val(value2)); } @@ -2501,6 +2652,7 @@ public class Factory implements FactoryOperations { * @see #bitXNor(Field, Field) * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitXNor(T value1, Field value2) { return bitXNor(val(value1), nullSafe(value2)); } @@ -2511,6 +2663,7 @@ public class Factory implements FactoryOperations { * @see #bitXNor(Field, Field) * @see #bitNot(Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitXNor(Field value1, T value2) { return bitXNor(nullSafe(value1), val(value2)); } @@ -2525,6 +2678,7 @@ public class Factory implements FactoryOperations { * ... or the not xor function elsewhere: *
bitnot(bitxor([field1], [field2]))
*/ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field bitXNor(Field field1, Field field2) { return new Expression(ExpressionOperator.BIT_XNOR, nullSafe(field1), nullSafe(field2)); } @@ -2535,6 +2689,7 @@ public class Factory implements FactoryOperations { * @see #shl(Field, Field) * @see #power(Field, Number) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field shl(T value1, T value2) { return shl(val(value1), val(value2)); } @@ -2545,6 +2700,7 @@ public class Factory implements FactoryOperations { * @see #shl(Field, Field) * @see #power(Field, Number) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field shl(T value1, Field value2) { return shl(val(value1), nullSafe(value2)); } @@ -2555,6 +2711,7 @@ public class Factory implements FactoryOperations { * @see #shl(Field, Field) * @see #power(Field, Number) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field shl(Fieldvalue1, T value2) { return shl(nullSafe(value1), val(value2)); } @@ -2568,6 +2725,7 @@ public class Factory implements FactoryOperations { * * @see #power(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field shl(Field field1, Field field2) { return new Expression(ExpressionOperator.SHL, nullSafe(field1), nullSafe(field2)); } @@ -2578,6 +2736,7 @@ public class Factory implements FactoryOperations { * @see #shr(Field, Field) * @see #power(Field, Number) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field shr(T value1, T value2) { return shr(val(value1), val(value2)); } @@ -2588,6 +2747,7 @@ public class Factory implements FactoryOperations { * @see #shr(Field, Field) * @see #power(Field, Number) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field shr(T value1, Field value2) { return shr(val(value1), nullSafe(value2)); } @@ -2598,6 +2758,7 @@ public class Factory implements FactoryOperations { * @see #shr(Field, Field) * @see #power(Field, Number) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field shr(Field value1, T value2) { return shr(nullSafe(value1), val(value2)); } @@ -2611,6 +2772,7 @@ public class Factory implements FactoryOperations { * * @see #power(Field, Field) */ + @Support({ ASE, DB2, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE, SQLITE }) public static Field shr(Field field1, Field field2) { return new Expression(ExpressionOperator.SHR, nullSafe(field1), nullSafe(field2)); } @@ -2630,6 +2792,7 @@ public class Factory implements FactoryOperations { * * @see #greatest(Field, Field...) */ + @Support public static Field greatest(T value, T... values) { return greatest(val(value), vals(values).toArray(new Field[0])); } @@ -2643,6 +2806,7 @@ public class Factory implements FactoryOperations { * n > 5! Better implementation suggestions are very * welcome. */ + @Support public static Field greatest(Field field, Field... others) { return new Greatest(nullSafeDataType(field), nullSafe(combine(field, others))); } @@ -2658,6 +2822,7 @@ public class Factory implements FactoryOperations { * * @see #least(Field, Field...) */ + @Support public static Field least(T value, T... values) { return least(val(value), vals(values).toArray(new Field[0])); } @@ -2671,6 +2836,7 @@ public class Factory implements FactoryOperations { * n > 5! Better implementation suggestions are very * welcome. */ + @Support public static Field least(Field field, Field... others) { return new Least(nullSafeDataType(field), nullSafe(combine(field, others))); } @@ -2680,6 +2846,7 @@ public class Factory implements FactoryOperations { * * @see #sign(Field) */ + @Support public static Field sign(Number value) { return sign(val(value)); } @@ -2696,6 +2863,7 @@ public class Factory implements FactoryOperations { * ELSE 0 * END */ + @Support public static Field sign(Field field) { return new Sign(nullSafe(field)); } @@ -2705,6 +2873,7 @@ public class Factory implements FactoryOperations { * * @see #abs(Field) */ + @Support public static Field abs(T value) { return abs(val(value)); } @@ -2715,6 +2884,7 @@ public class Factory implements FactoryOperations { * This renders the same on all dialects: *
abs([field])
*/ + @Support public static Field abs(Field field) { return function("abs", nullSafeDataType(field), nullSafe(field)); } @@ -2724,6 +2894,7 @@ public class Factory implements FactoryOperations { * * @see #round(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field round(T value) { return round(val(value)); } @@ -2736,6 +2907,7 @@ public class Factory implements FactoryOperations { * round([field], 0) * ... or simulates it elsewhere using floor and ceil */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field round(Field field) { return new Round(nullSafe(field)); } @@ -2745,6 +2917,7 @@ public class Factory implements FactoryOperations { * * @see #round(Field, int) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field round(T value, int decimals) { return round(val(value), decimals); } @@ -2756,6 +2929,7 @@ public class Factory implements FactoryOperations { *
round([field], [decimals])
* ... or simulates it elsewhere using floor and ceil */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field round(Field field, int decimals) { return new Round(nullSafe(field), decimals); } @@ -2765,6 +2939,7 @@ public class Factory implements FactoryOperations { * * @see #floor(Field) */ + @Support public static Field floor(T value) { return floor(val(value)); } @@ -2777,6 +2952,7 @@ public class Factory implements FactoryOperations { * ... or simulates it elsewhere using round: *
round([this] - 0.499999999999999)
*/ + @Support public static Field floor(Field field) { return new Floor(nullSafe(field)); } @@ -2786,6 +2962,7 @@ public class Factory implements FactoryOperations { * * @see #ceil(Field) */ + @Support public static Field ceil(T value) { return ceil(val(value)); } @@ -2799,6 +2976,7 @@ public class Factory implements FactoryOperations { * ... or simulates it elsewhere using round: *
round([field] + 0.499999999999999)
*/ + @Support public static Field ceil(Field field) { return new Ceil(nullSafe(field)); } @@ -2808,6 +2986,7 @@ public class Factory implements FactoryOperations { * * @see #sqrt(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field sqrt(Number value) { return sqrt(val(value)); } @@ -2820,6 +2999,7 @@ public class Factory implements FactoryOperations { * power (which in turn may also be simulated using ln and exp functions): *
power([field], 0.5)
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field sqrt(Field field) { return new Sqrt(nullSafe(field)); } @@ -2829,6 +3009,7 @@ public class Factory implements FactoryOperations { * * @see #exp(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field exp(Number value) { return exp(val(value)); } @@ -2839,6 +3020,7 @@ public class Factory implements FactoryOperations { * This renders the same on all dialects: *
exp([field])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field exp(Field field) { return function("exp", SQLDataType.NUMERIC, nullSafe(field)); } @@ -2848,6 +3030,7 @@ public class Factory implements FactoryOperations { * * @see #ln(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field ln(Number value) { return ln(val(value)); } @@ -2859,6 +3042,7 @@ public class Factory implements FactoryOperations { *
ln([field]) or
      * log([field])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field ln(Field field) { return new Ln(nullSafe(field)); } @@ -2868,6 +3052,7 @@ public class Factory implements FactoryOperations { * * @see #log(Field, int) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field log(Number value, int base) { return log(val(value), base); } @@ -2880,6 +3065,7 @@ public class Factory implements FactoryOperations { * most RDBMS) using the natural logarithm: *
ln([field]) / ln([base])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field log(Field field, int base) { return new Ln(nullSafe(field), base); } @@ -2889,6 +3075,7 @@ public class Factory implements FactoryOperations { * * @see #power(Field, Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field power(Number value, Number exponent) { return power(val(value), val(exponent)); } @@ -2898,6 +3085,7 @@ public class Factory implements FactoryOperations { * * @see #power(Field, Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field power(Field field, Number exponent) { return power(nullSafe(field), val(exponent)); } @@ -2907,6 +3095,7 @@ public class Factory implements FactoryOperations { * * @see #power(Field, Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field power(Number value, Field exponent) { return power(val(value), nullSafe(exponent)); } @@ -2919,6 +3108,7 @@ public class Factory implements FactoryOperations { * elsewhere using ln and exp: *
exp(ln([field]) * [exponent])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field power(Field field, Field exponent) { return new Power(nullSafe(field), nullSafe(exponent)); } @@ -2928,6 +3118,7 @@ public class Factory implements FactoryOperations { * * @see #acos(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field acos(Number value) { return acos(val(value)); } @@ -2938,6 +3129,7 @@ public class Factory implements FactoryOperations { * This renders the acos function where available: *
acos([field])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field acos(Field field) { return function("acos", SQLDataType.NUMERIC, nullSafe(field)); } @@ -2947,6 +3139,7 @@ public class Factory implements FactoryOperations { * * @see #asin(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field asin(Number value) { return asin(val(value)); } @@ -2957,6 +3150,7 @@ public class Factory implements FactoryOperations { * This renders the asin function where available: *
asin([field])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field asin(Field field) { return function("asin", SQLDataType.NUMERIC, nullSafe(field)); } @@ -2966,6 +3160,7 @@ public class Factory implements FactoryOperations { * * @see #atan(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field atan(Number value) { return atan(val(value)); } @@ -2976,6 +3171,7 @@ public class Factory implements FactoryOperations { * This renders the atan function where available: *
atan([field])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field atan(Field field) { return function("atan", SQLDataType.NUMERIC, nullSafe(field)); } @@ -2985,6 +3181,7 @@ public class Factory implements FactoryOperations { * * @see #atan2(Field, Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field atan2(Number x, Number y) { return atan2(val(x), val(y)); } @@ -2994,6 +3191,7 @@ public class Factory implements FactoryOperations { * * @see #atan2(Field, Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field atan2(Number x, Field y) { return atan2(val(x), nullSafe(y)); } @@ -3003,6 +3201,7 @@ public class Factory implements FactoryOperations { * * @see #atan2(Field, Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field atan2(Field x, Number y) { return atan2(nullSafe(x), val(y)); } @@ -3014,6 +3213,7 @@ public class Factory implements FactoryOperations { *
atan2([x], [y]) or
      * atn2([x], [y])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field atan2(Field x, Field y) { return new Function(Term.ATAN2, SQLDataType.NUMERIC, nullSafe(x), nullSafe(y)); } @@ -3023,6 +3223,7 @@ public class Factory implements FactoryOperations { * * @see #cos(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field cos(Number value) { return cos(val(value)); } @@ -3033,6 +3234,7 @@ public class Factory implements FactoryOperations { * This renders the cos function where available: *
cos([field])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field cos(Field field) { return function("cos", SQLDataType.NUMERIC, nullSafe(field)); } @@ -3042,6 +3244,7 @@ public class Factory implements FactoryOperations { * * @see #sin(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field sin(Number value) { return sin(val(value)); } @@ -3052,6 +3255,7 @@ public class Factory implements FactoryOperations { * This renders the sin function where available: *
sin([field])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field sin(Field field) { return function("sin", SQLDataType.NUMERIC, nullSafe(field)); } @@ -3061,6 +3265,7 @@ public class Factory implements FactoryOperations { * * @see #tan(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field tan(Number value) { return tan(val(value)); } @@ -3071,6 +3276,7 @@ public class Factory implements FactoryOperations { * This renders the tan function where available: *
tan([field])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field tan(Field field) { return function("tan", SQLDataType.NUMERIC, nullSafe(field)); } @@ -3080,6 +3286,7 @@ public class Factory implements FactoryOperations { * * @see #cot(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field cot(Number value) { return cot(val(value)); } @@ -3091,6 +3298,7 @@ public class Factory implements FactoryOperations { *
cot([field])
... or simulates it elsewhere using * sin and cos:
cos([field]) / sin([field])
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field cot(Field field) { return new Cot(nullSafe(field)); } @@ -3100,6 +3308,7 @@ public class Factory implements FactoryOperations { * * @see #sinh(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field sinh(Number value) { return sinh(val(value)); } @@ -3111,6 +3320,7 @@ public class Factory implements FactoryOperations { *
sinh([field])
... or simulates it elsewhere using * exp:
(exp([field] * 2) - 1) / (exp([field] * 2))
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field sinh(Field field) { return new Sinh(nullSafe(field)); } @@ -3120,6 +3330,7 @@ public class Factory implements FactoryOperations { * * @see #cosh(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field cosh(Number value) { return cosh(val(value)); } @@ -3131,6 +3342,7 @@ public class Factory implements FactoryOperations { *
cosh([field])
... or simulates it elsewhere using * exp:
(exp([field] * 2) + 1) / (exp([field] * 2))
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field cosh(Field field) { return new Cosh(nullSafe(field)); } @@ -3140,6 +3352,7 @@ public class Factory implements FactoryOperations { * * @see #tanh(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field tanh(Number value) { return tanh(val(value)); } @@ -3152,6 +3365,7 @@ public class Factory implements FactoryOperations { * exp: *
(exp([field] * 2) - 1) / (exp([field] * 2) + 1)
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field tanh(Field field) { return new Tanh(nullSafe(field)); } @@ -3161,6 +3375,7 @@ public class Factory implements FactoryOperations { * * @see #coth(Field) */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field coth(Number value) { return coth(val(value)); } @@ -3171,6 +3386,7 @@ public class Factory implements FactoryOperations { * This is not supported by any RDBMS, but simulated using exp exp: *
(exp([field] * 2) + 1) / (exp([field] * 2) - 1)
*/ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field coth(Field field) { field = nullSafe(field); return exp(field.mul(2)).add(1).div(exp(field.mul(2)).sub(1)); @@ -3181,6 +3397,7 @@ public class Factory implements FactoryOperations { * * @see #deg(Field) */ + @Support public static Field deg(Number value) { return deg(val(value)); } @@ -3192,6 +3409,7 @@ public class Factory implements FactoryOperations { *
degrees([field])
... or simulates it elsewhere: *
[field] * 180 / PI
*/ + @Support public static Field deg(Field field) { return new Degrees(nullSafe(field)); } @@ -3201,6 +3419,7 @@ public class Factory implements FactoryOperations { * * @see #rad(Field) */ + @Support public static Field rad(Number value) { return rad(val(value)); } @@ -3212,6 +3431,7 @@ public class Factory implements FactoryOperations { *
degrees([field])
... or simulates it elsewhere: *
[field] * PI / 180
*/ + @Support public static Field rad(Field field) { return new Radians(nullSafe(field)); } @@ -3223,6 +3443,7 @@ public class Factory implements FactoryOperations { /** * Get the count(*) function */ + @Support public static AggregateFunction count() { return new Count(field("*", Integer.class), false); } @@ -3230,6 +3451,7 @@ public class Factory implements FactoryOperations { /** * Get the count(field) function */ + @Support public static AggregateFunction count(Field field) { return new Count(nullSafe(field), false); } @@ -3237,6 +3459,7 @@ public class Factory implements FactoryOperations { /** * Get the count(distinct field) function */ + @Support public static AggregateFunction countDistinct(Field field) { return new Count(nullSafe(field), true); } @@ -3244,6 +3467,7 @@ public class Factory implements FactoryOperations { /** * Get the max value over a field: max(field) */ + @Support public static AggregateFunction max(Field field) { return new AggregateFunctionImpl("max", nullSafeDataType(field), nullSafe(field)); } @@ -3251,6 +3475,7 @@ public class Factory implements FactoryOperations { /** * Get the min value over a field: min(field) */ + @Support public static AggregateFunction min(Field field) { return new AggregateFunctionImpl("min", nullSafeDataType(field), nullSafe(field)); } @@ -3258,6 +3483,7 @@ public class Factory implements FactoryOperations { /** * Get the sum over a numeric field: sum(field) */ + @Support public static AggregateFunction sum(Field field) { return new AggregateFunctionImpl("sum", SQLDataType.NUMERIC, nullSafe(field)); } @@ -3265,6 +3491,7 @@ public class Factory implements FactoryOperations { /** * Get the average over a numeric field: avg(field) */ + @Support public static AggregateFunction avg(Field field) { return new AggregateFunctionImpl("avg", SQLDataType.NUMERIC, nullSafe(field)); } @@ -3279,6 +3506,7 @@ public class Factory implements FactoryOperations { *
  • Sybase SQL Anywhere
  • * */ + @Support({ HSQLDB, ORACLE, SYBASE }) public static AggregateFunction median(Field field) { return new AggregateFunctionImpl("median", SQLDataType.NUMERIC, nullSafe(field)); } @@ -3300,6 +3528,7 @@ public class Factory implements FactoryOperations { *
  • Sybase SQL Anywhere
  • * */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static AggregateFunction stddevPop(Field field) { return new AggregateFunctionImpl(Term.STDDEV_POP, SQLDataType.NUMERIC, nullSafe(field)); } @@ -3321,6 +3550,7 @@ public class Factory implements FactoryOperations { *
  • Sybase SQL Anywhere
  • * */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static AggregateFunction stddevSamp(Field field) { return new AggregateFunctionImpl(Term.STDDEV_SAMP, SQLDataType.NUMERIC, nullSafe(field)); } @@ -3342,6 +3572,7 @@ public class Factory implements FactoryOperations { *
  • Sybase SQL Anywhere
  • * */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static AggregateFunction varPop(Field field) { return new AggregateFunctionImpl(Term.VAR_POP, SQLDataType.NUMERIC, nullSafe(field)); } @@ -3361,6 +3592,7 @@ public class Factory implements FactoryOperations { *
  • Sybase SQL Anywhere
  • * */ + @Support({ ASE, DB2, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static AggregateFunction varSamp(Field field) { return new AggregateFunctionImpl(Term.VAR_SAMP, SQLDataType.NUMERIC, nullSafe(field)); } @@ -3375,6 +3607,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE, SQLSERVER, SYBASE }) public static WindowOverStep rowNumber() { return new WindowFunction("row_number", SQLDataType.INTEGER); } @@ -3385,6 +3618,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE, SQLSERVER, SYBASE }) public static WindowOverStep rank() { return new WindowFunction("rank", SQLDataType.INTEGER); } @@ -3395,6 +3629,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE, SQLSERVER, SYBASE }) public static WindowOverStep denseRank() { return new WindowFunction("dense_rank", SQLDataType.INTEGER); } @@ -3405,6 +3640,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ POSTGRES, ORACLE, SYBASE }) public static WindowOverStep percentRank() { return new WindowFunction("percent_rank", SQLDataType.NUMERIC); } @@ -3415,6 +3651,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ POSTGRES, ORACLE, SYBASE }) public static WindowOverStep cumeDist() { return new WindowFunction("cume_dist", SQLDataType.NUMERIC); } @@ -3425,6 +3662,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE, SQLSERVER, SYBASE }) public static WindowOverStep ntile(int number) { return new WindowFunction("ntile", SQLDataType.NUMERIC, field("" + number, Integer.class)); } @@ -3435,6 +3673,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE, SYBASE }) public static WindowIgnoreNullsStep firstValue(Field field) { return new WindowFunction("first_value", nullSafeDataType(field), nullSafe(field)); } @@ -3445,6 +3684,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE, SYBASE }) public static WindowIgnoreNullsStep lastValue(Field field) { return new WindowFunction("last_value", nullSafeDataType(field), nullSafe(field)); } @@ -3455,6 +3695,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE }) public static WindowIgnoreNullsStep lead(Field field) { return new WindowFunction("lead", nullSafeDataType(field), nullSafe(field)); } @@ -3465,6 +3706,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE }) public static WindowIgnoreNullsStep lead(Field field, int offset) { return new WindowFunction("lead", nullSafeDataType(field), nullSafe(field), literal(offset)); } @@ -3477,6 +3719,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE }) public static WindowIgnoreNullsStep lead(Field field, int offset, T defaultValue) { return lead(nullSafe(field), offset, val(defaultValue)); } @@ -3489,6 +3732,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE }) public static WindowIgnoreNullsStep lead(Field field, int offset, Field defaultValue) { return new WindowFunction("lead", nullSafeDataType(field), nullSafe(field), literal(offset), nullSafe(defaultValue)); } @@ -3499,6 +3743,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE }) public static WindowIgnoreNullsStep lag(Field field) { return new WindowFunction("lag", nullSafeDataType(field), nullSafe(field)); } @@ -3509,6 +3754,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE }) public static WindowIgnoreNullsStep lag(Field field, int offset) { return new WindowFunction("lag", nullSafeDataType(field), nullSafe(field), literal(offset)); } @@ -3521,6 +3767,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE }) public static WindowIgnoreNullsStep lag(Field field, int offset, T defaultValue) { return lag(nullSafe(field), offset, val(defaultValue)); } @@ -3533,6 +3780,7 @@ public class Factory implements FactoryOperations { * Window functions are supported in DB2, Postgres, Oracle, SQL Server and * Sybase. */ + @Support({ DB2, POSTGRES, ORACLE }) public static WindowIgnoreNullsStep lag(Field field, int offset, Field defaultValue) { return new WindowFunction("lag", nullSafeDataType(field), nullSafe(field), literal(offset), nullSafe(defaultValue)); } @@ -3560,6 +3808,7 @@ public class Factory implements FactoryOperations { * * @see #param(String, Object) */ + @Support public static Param param(String name) { return param(name, Object.class); } @@ -3569,6 +3818,7 @@ public class Factory implements FactoryOperations { * * @see #param(String, Object) */ + @Support public static Param param(String name, Class type) { return param(name, SQLDataType.getDataType(null, type)); } @@ -3578,6 +3828,7 @@ public class Factory implements FactoryOperations { * * @see #param(String, Object) */ + @Support public static Param param(String name, DataType type) { return new Val(null, type, name); } @@ -3599,6 +3850,7 @@ public class Factory implements FactoryOperations { * @see Query#getParams() * @see #renderNamedParams(QueryPart) */ + @Support public static Param param(String name, T value) { return new Val(value, val(value).getDataType(), name); } @@ -3609,6 +3861,7 @@ public class Factory implements FactoryOperations { * * @see #val(Object) */ + @Support public static Field value(T value) { return val(value); } @@ -3619,6 +3872,7 @@ public class Factory implements FactoryOperations { * * @see #val(Object, Class) */ + @Support public static Field value(Object value, Class type) { return val(value, type); } @@ -3629,6 +3883,7 @@ public class Factory implements FactoryOperations { * * @see #val(Object, Field) */ + @Support public static Field value(Object value, Field field) { return val(value, field); } @@ -3639,6 +3894,7 @@ public class Factory implements FactoryOperations { * * @see #val(Object, DataType) */ + @Support public static Field value(Object value, DataType type) { return val(value, type); } @@ -3668,6 +3924,7 @@ public class Factory implements FactoryOperations { * @return A field representing the constant value */ @SuppressWarnings("unchecked") + @Support public static Field val(T value) { // null is intercepted immediately @@ -3695,6 +3952,7 @@ public class Factory implements FactoryOperations { * @return A field representing the constant value * @see #val(Object, DataType) */ + @Support public static Field val(Object value, Class type) { return val(value, getDataType(type)); } @@ -3708,6 +3966,7 @@ public class Factory implements FactoryOperations { * @return A field representing the constant value * @see #val(Object, DataType) */ + @Support public static Field val(Object value, Field field) { return val(value, nullSafeDataType(field)); } @@ -3726,6 +3985,7 @@ public class Factory implements FactoryOperations { * @return A field representing the constant value */ @SuppressWarnings({ "unchecked", "rawtypes" }) + @Support public static Field val(Object value, DataType type) { // Prevent errors due to type erasure and unchecked invocation @@ -3750,6 +4010,7 @@ public class Factory implements FactoryOperations { /** * Get a list of values and fields */ + @Support public static List> vals(Object... values) { FieldList result = new FieldList(); @@ -3789,6 +4050,7 @@ public class Factory implements FactoryOperations { * @return The literal as a field */ @SuppressWarnings("unchecked") + @Support public static Field literal(T literal) { if (literal == null) { return (Field) NULL(); @@ -3814,6 +4076,7 @@ public class Factory implements FactoryOperations { * @param type The literal's data type * @return The literal as a field */ + @Support public static Field literal(Object literal, Class type) { return literal(literal, getDataType(type)); } @@ -3835,6 +4098,7 @@ public class Factory implements FactoryOperations { * @return The literal as a field */ @SuppressWarnings("unchecked") + @Support public static Field literal(Object literal, DataType type) { if (literal == null) { return (Field) NULL(); @@ -3889,6 +4153,7 @@ public class Factory implements FactoryOperations { * * @return A 0 literal as a Field */ + @Support public static Field zero() { return literal(0); } @@ -3903,6 +4168,7 @@ public class Factory implements FactoryOperations { * * @return A 1 literal as a Field */ + @Support public static Field one() { return literal(1); } @@ -3915,6 +4181,7 @@ public class Factory implements FactoryOperations { * * @return A 2 literal as a Field */ + @Support public static Field two() { return literal(2); } @@ -3928,6 +4195,7 @@ public class Factory implements FactoryOperations { *
  • {@link Math#PI}
  • * */ + @Support public static Field pi() { return new Pi(); } @@ -3941,6 +4209,7 @@ public class Factory implements FactoryOperations { *
  • {@link Math#E}
  • * */ + @Support public static Field e() { return new Euler(); } @@ -3954,6 +4223,7 @@ public class Factory implements FactoryOperations { *

    * This translates into any dialect */ + @Support public static Field currentDate() { return new CurrentDate(); } @@ -3963,6 +4233,7 @@ public class Factory implements FactoryOperations { *

    * This translates into any dialect */ + @Support public static Field

    * This translates into any dialect */ + @Support public static Field currentTimestamp() { return new CurrentTimestamp(); } @@ -3981,6 +4253,7 @@ public class Factory implements FactoryOperations { *

    * This translates into any dialect */ + @Support({ ASE, DB2, DERBY, H2, HSQLDB, INGRES, MYSQL, ORACLE, POSTGRES, SQLSERVER, SYBASE }) public static Field currentUser() { return new CurrentUser(); } @@ -3988,6 +4261,7 @@ public class Factory implements FactoryOperations { /** * Get the rand() function */ + @Support public static Field rand() { return new Rand(); } @@ -4130,6 +4404,7 @@ public class Factory implements FactoryOperations { * @return The Factory's underlying default data type. */ @SuppressWarnings("deprecation") + @Support public static DataType getDataType(Class type) { return FieldTypeHelper.getDataType(SQLDialect.SQL99, type); }