diff --git a/jOOQ/src/main/java/org/jooq/Field.java b/jOOQ/src/main/java/org/jooq/Field.java index 3fd3092bca..5583d9da01 100644 --- a/jOOQ/src/main/java/org/jooq/Field.java +++ b/jOOQ/src/main/java/org/jooq/Field.java @@ -459,7 +459,7 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider mod(Field value); // ------------------------------------------------------------------------ - // Conditions created from this field + // NULL predicates // ------------------------------------------------------------------------ /** @@ -478,6 +478,10 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProviderDISTINCT from * another value @@ -546,101 +550,9 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider field); - /** - * Create a condition to check this field against known string literals for - * true - *

- * SQL: - * lcase(this) in ("1", "y", "yes", "true", "on", "enabled") - */ - @Support - Condition isTrue(); - - /** - * Create a condition to check this field against known string literals for - * false - *

- * SQL: - * lcase(this) in ("0", "n", "no", "false", "off", "disabled") - */ - @Support - Condition isFalse(); - - /** - * Create a condition to pattern-check this field against a value - *

- * SQL: this like value - */ - @Support - Condition like(Field value); - - /** - * Create a condition to pattern-check this field against a value - *

- * SQL: this like value escape 'e' - */ - @Support - Condition like(Field value, char escape); - - /** - * Create a condition to pattern-check this field against a value - *

- * SQL: this like value - */ - @Support - Condition like(String value); - - /** - * Create a condition to pattern-check this field against a value - *

- * SQL: this like value escape 'e' - */ - @Support - Condition like(String value, char escape); - - /** - * Create a condition to case-insensitively pattern-check this field against - * a value - *

- * This translates to this ilike value in - * {@link SQLDialect#POSTGRES}, or to - * lower(this) like lower(value) in all other dialects. - */ - @Support - Condition likeIgnoreCase(Field value); - - /** - * Create a condition to case-insensitively pattern-check this field against - * a value - *

- * This translates to this ilike value in - * {@link SQLDialect#POSTGRES}, or to - * lower(this) like lower(value) in all other dialects. - */ - @Support - Condition likeIgnoreCase(Field value, char escape); - - /** - * Create a condition to case-insensitively pattern-check this field against - * a value - *

- * This translates to this ilike value in - * {@link SQLDialect#POSTGRES}, or to - * lower(this) like lower(value) in all other dialects. - */ - @Support - Condition likeIgnoreCase(String value); - - /** - * Create a condition to case-insensitively pattern-check this field against - * a value - *

- * This translates to this ilike value in - * {@link SQLDialect#POSTGRES}, or to - * lower(this) like lower(value) in all other dialects. - */ - @Support - Condition likeIgnoreCase(String value, char escape); + // ------------------------------------------------------------------------ + // LIKE_REGEX predicates + // ------------------------------------------------------------------------ /** * Create a condition to regex-pattern-check this field against a pattern @@ -778,6 +690,106 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider pattern); + /** + * Create a condition to regex-pattern-check this field against a pattern + *

+ * See {@link #likeRegex(String)} for more details + * + * @see #likeRegex(String) + */ + @Support({ CUBRID, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLITE, SYBASE }) + Condition notLikeRegex(String pattern); + + /** + * Create a condition to regex-pattern-check this field against a pattern + *

+ * See {@link #likeRegex(String)} for more details + * + * @see #likeRegex(Field) + */ + @Support({ CUBRID, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLITE, SYBASE }) + Condition notLikeRegex(Field pattern); + + // ------------------------------------------------------------------------ + // LIKE predicates + // ------------------------------------------------------------------------ + + /** + * Create a condition to pattern-check this field against a value + *

+ * SQL: this like value + */ + @Support + Condition like(Field value); + + /** + * Create a condition to pattern-check this field against a value + *

+ * SQL: this like value escape 'e' + */ + @Support + Condition like(Field value, char escape); + + /** + * Create a condition to pattern-check this field against a value + *

+ * SQL: this like value + */ + @Support + Condition like(String value); + + /** + * Create a condition to pattern-check this field against a value + *

+ * SQL: this like value escape 'e' + */ + @Support + Condition like(String value, char escape); + + /** + * Create a condition to case-insensitively pattern-check this field against + * a value + *

+ * This translates to this ilike value in + * {@link SQLDialect#POSTGRES}, or to + * lower(this) like lower(value) in all other dialects. + */ + @Support + Condition likeIgnoreCase(Field value); + + /** + * Create a condition to case-insensitively pattern-check this field against + * a value + *

+ * This translates to this ilike value in + * {@link SQLDialect#POSTGRES}, or to + * lower(this) like lower(value) in all other dialects. + */ + @Support + Condition likeIgnoreCase(Field value, char escape); + + /** + * Create a condition to case-insensitively pattern-check this field against + * a value + *

+ * This translates to this ilike value in + * {@link SQLDialect#POSTGRES}, or to + * lower(this) like lower(value) in all other dialects. + */ + @Support + Condition likeIgnoreCase(String value); + + /** + * Create a condition to case-insensitively pattern-check this field against + * a value + *

+ * This translates to this ilike value in + * {@link SQLDialect#POSTGRES}, or to + * lower(this) like lower(value) in all other dialects. + */ + @Support + Condition likeIgnoreCase(String value, char escape); + /** * Create a condition to pattern-check this field against a value *

@@ -854,26 +866,6 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider - * See {@link #likeRegex(String)} for more details - * - * @see #likeRegex(String) - */ - @Support({ CUBRID, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLITE, SYBASE }) - Condition notLikeRegex(String pattern); - - /** - * Create a condition to regex-pattern-check this field against a pattern - *

- * See {@link #likeRegex(String)} for more details - * - * @see #likeRegex(Field) - */ - @Support({ CUBRID, H2, HSQLDB, MYSQL, ORACLE, POSTGRES, SQLITE, SYBASE }) - Condition notLikeRegex(Field pattern); - /** * Convenience method for {@link #like(String, char)} including proper * adding of wildcards and escaping @@ -988,6 +980,10 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider value); + // ------------------------------------------------------------------------ + // IN predicates + // ------------------------------------------------------------------------ + /** * Create a condition to check this field against several values *

@@ -1076,6 +1072,10 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider query); + // ------------------------------------------------------------------------ + // BETWEEN predicates + // ------------------------------------------------------------------------ + /** * Create a condition to check this field against some bounds *

@@ -1108,6 +1108,10 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider minValue, Field maxValue); + // ------------------------------------------------------------------------ + // Comparison predicates + // ------------------------------------------------------------------------ + /** * this = value *

@@ -1124,6 +1128,126 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider field); + /** + * this = (Select ...) + */ + @Support + Condition equal(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 + Condition notEqual(Select query); + + /** + * this < value + */ + @Support + Condition lessThan(T value); + + /** + * this < field + */ + @Support + Condition lessThan(Field field); + + /** + * this < (Select ...) + */ + @Support + Condition lessThan(Select query); + + /** + * this <= value + */ + @Support + Condition lessOrEqual(T value); + + /** + * this <= field + */ + @Support + Condition lessOrEqual(Field field); + + /** + * this <= (Select ...) + */ + @Support + Condition lessOrEqual(Select query); + + /** + * this > value + */ + @Support + Condition greaterThan(T value); + + /** + * this > field + */ + @Support + Condition greaterThan(Field field); + + /** + * this > (Select ...) + */ + @Support + Condition greaterThan(Select query); + + /** + * this >= value + */ + @Support + Condition greaterOrEqual(T value); + + /** + * this >= field + */ + @Support + Condition greaterOrEqual(Field field); + + /** + * this >= (Select ...) + */ + @Support + Condition greaterOrEqual(Select query); + + /** + * Create a condition to check this field against known string literals for + * true + *

+ * SQL: + * lcase(this) in ("1", "y", "yes", "true", "on", "enabled") + */ + @Support + Condition isTrue(); + + /** + * Create a condition to check this field against known string literals for + * false + *

+ * SQL: + * lcase(this) in ("0", "n", "no", "false", "off", "disabled") + */ + @Support + Condition isFalse(); + /** * lower(this) = lower(value) */ @@ -1137,10 +1261,20 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider value); /** - * this = (Select ...) + * lower(this) != lower(value) */ @Support - Condition equal(Select query); + Condition notEqualIgnoreCase(String value); + + /** + * lower(this) != lower(value) + */ + @Support + Condition notEqualIgnoreCase(Field value); + + // ------------------------------------------------------------------------ + // Quantified comparison predicates + // ------------------------------------------------------------------------ /** * this = any (Select ...) @@ -1199,40 +1333,6 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider array); - /** - * 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); - - /** - * lower(this) != lower(value) - */ - @Support - Condition notEqualIgnoreCase(String value); - - /** - * lower(this) != lower(value) - */ - @Support - Condition notEqualIgnoreCase(Field value); - - /** - * this != (Select ...) - */ - @Support - Condition notEqual(Select query); - /** * this != any (Select ...) */ @@ -1290,24 +1390,6 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider array); - /** - * this < value - */ - @Support - Condition lessThan(T value); - - /** - * this < field - */ - @Support - Condition lessThan(Field field); - - /** - * this < (Select ...) - */ - @Support - Condition lessThan(Select query); - /** * this < any (Select ...) */ @@ -1365,24 +1447,6 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider array); - /** - * this <= value - */ - @Support - Condition lessOrEqual(T value); - - /** - * this <= field - */ - @Support - Condition lessOrEqual(Field field); - - /** - * this <= (Select ...) - */ - @Support - Condition lessOrEqual(Select query); - /** * this <= any (Select ...) */ @@ -1440,24 +1504,6 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider array); - /** - * this > value - */ - @Support - Condition greaterThan(T value); - - /** - * this > field - */ - @Support - Condition greaterThan(Field field); - - /** - * this > (Select ...) - */ - @Support - Condition greaterThan(Select query); - /** * this > any (Select ...) */ @@ -1515,24 +1561,6 @@ public interface Field extends NamedTypeProviderQueryPart, AliasProvider array); - /** - * this >= value - */ - @Support - Condition greaterOrEqual(T value); - - /** - * this >= field - */ - @Support - Condition greaterOrEqual(Field field); - - /** - * this >= (Select ...) - */ - @Support - Condition greaterOrEqual(Select query); - /** * this >= any (Select ...) */