diff --git a/jOOQ-website/src/main/resources/manual-2.5.xml b/jOOQ-website/src/main/resources/manual-2.5.xml index d8f713e6f3..3222efd7d2 100644 --- a/jOOQ-website/src/main/resources/manual-2.5.xml +++ b/jOOQ-website/src/main/resources/manual-2.5.xml @@ -134,7 +134,7 @@ CREATE TABLE t_book_to_book_store (
@@ -637,7 +637,7 @@ Factory.concat(Factory.trim(FIRST_NAME), Factory.trim(LAST_NAME)); As any Configuration object, a Factory can be supplied with these objects:
+ jOOQ allows you to freely create arbitrary column expressions using a fluent expression construction API. Many expressions can be formed as functions from
+ In general, it is up to you whether you want to use the "prefix" notation or the "postfix" notation to create new column expressions based on existing ones. The "SQL way" would be to use the "prefix notation", with functions created from the
+ jOOQ's source code generator tries to find the most accurate type mapping between your vendor-specific data types and a matching Java type. For instance, most VARCHAR, CHAR, CLOB types will map to String. Most BINARY, BYTEA, BLOB types will map to byte[]. NUMERIC types will default to java.math.BigDecimal, but can also be any of java.math.BigInteger, Long, Integer, Short, Byte, Double, Float. +
++ Sometimes, this automatic mapping might not be what you needed, or jOOQ cannot know the type of a field. In those cases you would write SQL type CASTs like this: +
+ ++ in jOOQ, you can write something like that: +
+ ++ The same thing can be achieved by casting a Field directly to String.class, as TEXT is the default data type in Postgres to map to Java's String +
+ ++ The complete CAST API in Field consists of these three methods: +
+ +
+ Your database can do the math for you. Arithmetic operations are implemented just like
+ In order to express a SQL query like this one: +
+ ++ You can write something like this in jOOQ: +
+ ++ jOOQ also supports the Oracle-style syntax for adding days to a Field<? extends java.util.Date> +
+ ++ For more advanced datetime arithmetic, use the Factory's timestampDiff() and dateDiff() functions, as well as jOOQ's built-in SQL standard INTERVAL data type support: +
+
+ The SQL standard defines the concatenation operator to be an infix operator, similar to the ones we've seen in the chapter about ||. Some other dialects do not support this operator, but expect a concat() function, instead. jOOQ renders the right operator / function, depending on your
+ Aggregate functions work just like functions, even if they have a slightly different semantics. Here are some example aggregate functions from the
+ Here's an example, counting the number of books any author has written: +
+ +
+ Aggregate functions have strong limitations about when they may be used and when not. For instance, you can use aggregate functions in scalar queries. Typically, this means you only select aggregate functions, no
+ Oracle and some other databases support "ordered aggregate functions". This means you can provide an ORDER BY clause to an aggregate function, which will be taken into consideration when aggregating. The best example for this is Oracle's LISTAGG() (also known as GROUP_CONCAT in other
+ The above query might yield: +
+ +
+ jOOQ also supports using your own user-defined aggregate functions. See the manual's section about
+ In those databases that support over() on it. See the manual's section about