From 13943d1fbc79dfd54a2a11ae4bef48956a533397 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Sat, 17 Sep 2011 13:44:19 +0000 Subject: [PATCH] Added some sections to the manual --- .../manual/ADVANCED/CONNECTBY/index.php | 2 +- jOOQ-website/manual/ADVANCED/Export/index.php | 2 +- jOOQ-website/manual/ADVANCED/Import/index.php | 2 +- .../manual/ADVANCED/MasterData/index.php | 2 +- .../manual/ADVANCED/OracleHints/index.php | 2 +- .../manual/ADVANCED/SchemaMapping/index.php | 2 +- jOOQ-website/manual/DSL/ALIAS/index.php | 2 +- jOOQ-website/manual/DSL/ARITHMETIC/index.php | 2 +- jOOQ-website/manual/DSL/CASE/index.php | 2 +- jOOQ-website/manual/DSL/CAST/index.php | 2 +- jOOQ-website/manual/DSL/CONDITION/index.php | 2 +- jOOQ-website/manual/DSL/EXISTS/index.php | 2 +- jOOQ-website/manual/DSL/FUNCTIONS/index.php | 2 +- jOOQ-website/manual/DSL/IN/index.php | 2 +- jOOQ-website/manual/DSL/NESTED/index.php | 2 +- jOOQ-website/manual/DSL/PROCEDURES/index.php | 2 +- jOOQ-website/manual/DSL/SELECT/index.php | 2 +- jOOQ-website/manual/DSL/SQL/index.php | 2 +- jOOQ-website/manual/DSL/UNION/index.php | 2 +- jOOQ-website/manual/DSL/index.php | 2 +- .../manual/JOOQ/ExampleDatabase/index.php | 2 +- jOOQ-website/manual/JOOQ/Extend/index.php | 2 +- jOOQ-website/manual/JOOQ/Factory/index.php | 24 +-- jOOQ-website/manual/JOOQ/Query/index.php | 2 +- jOOQ-website/manual/JOOQ/QueryPart/index.php | 2 +- jOOQ-website/manual/JOOQ/Result/index.php | 2 +- .../manual/JOOQ/ResultQuery/index.php | 2 +- .../manual/JOOQ/Serializability/index.php | 2 +- jOOQ-website/manual/JOOQ/Table/index.php | 134 ++++++++++++++++- .../manual/JOOQ/UpdatableRecord/index.php | 2 +- jOOQ-website/manual/JOOQ/index.php | 6 +- .../manual/META/Configuration/index.php | 2 +- jOOQ-website/manual/META/PROCEDURE/index.php | 2 +- jOOQ-website/manual/META/SCHEMA/index.php | 2 +- jOOQ-website/manual/META/SEQUENCE/index.php | 2 +- jOOQ-website/manual/META/TABLE/index.php | 2 +- jOOQ-website/manual/META/UDT/index.php | 2 +- jOOQ-website/manual/META/index.php | 2 +- jOOQ-website/manual/index.php | 10 +- .../src/main/resources/html-pages.xsl | 21 ++- jOOQ-website/src/main/resources/manual.xml | 137 ++++++++++++++++++ 41 files changed, 341 insertions(+), 61 deletions(-) diff --git a/jOOQ-website/manual/ADVANCED/CONNECTBY/index.php b/jOOQ-website/manual/ADVANCED/CONNECTBY/index.php index 68af36d092..274265e102 100644 --- a/jOOQ-website/manual/ADVANCED/CONNECTBY/index.php +++ b/jOOQ-website/manual/ADVANCED/CONNECTBY/index.php @@ -14,7 +14,7 @@ function printContent() { ?> - +
The jOOQ User Manual : Advanced topics : The Oracle CONNECT BY clause for hierarchical queriesprevious : nextThe jOOQ User Manual : Advanced topics : The Oracle CONNECT BY clause for hierarchical queriesprevious : next
- +
The jOOQ User Manual : Advanced topics : Exporting data to XML, CSV, JSON, HTML, Textprevious : nextThe jOOQ User Manual : Advanced topics : Exporting data to XML, CSV, JSON, HTML, Textprevious : next
- +
The jOOQ User Manual : Advanced topics : Importing data from XML, CSVpreviousThe jOOQ User Manual : Advanced topics : Importing data from XML, CSVprevious
- +
The jOOQ User Manual : Advanced topics : Master data generationprevious : nextThe jOOQ User Manual : Advanced topics : Master data generationprevious : next
- +
The jOOQ User Manual : Advanced topics : Adding Oracle hints to queriesprevious : nextThe jOOQ User Manual : Advanced topics : Adding Oracle hints to queriesprevious : next
- +
The jOOQ User Manual : Advanced topics : Mapping generated schemata and tables to productive environmentsprevious : nextThe jOOQ User Manual : Advanced topics : Mapping generated schemata and tables to productive environmentsprevious : next
- +
The jOOQ User Manual : DSL or fluent API : Aliased tables and fieldsprevious : nextThe jOOQ User Manual : DSL or fluent API : Aliased tables and fieldsprevious : next
- +
The jOOQ User Manual : DSL or fluent API : Arithmetic operationsprevious : nextThe jOOQ User Manual : DSL or fluent API : Arithmetic operationsprevious : next
- +
The jOOQ User Manual : DSL or fluent API : The CASE clauseprevious : nextThe jOOQ User Manual : DSL or fluent API : The CASE clauseprevious : next
- +
The jOOQ User Manual : DSL or fluent API : Type castingprevious : nextThe jOOQ User Manual : DSL or fluent API : Type castingprevious : next
- +
The jOOQ User Manual : DSL or fluent API : Conditionsprevious : nextThe jOOQ User Manual : DSL or fluent API : Conditionsprevious : next
- +
The jOOQ User Manual : DSL or fluent API : Nested select statements using the EXISTS operatorprevious : nextThe jOOQ User Manual : DSL or fluent API : Nested select statements using the EXISTS operatorprevious : next
- +
The jOOQ User Manual : DSL or fluent API : Functions, aggregate operators, and window functionsprevious : nextThe jOOQ User Manual : DSL or fluent API : Functions, aggregate operators, and window functionsprevious : next
- +
The jOOQ User Manual : DSL or fluent API : Nested select statements using the IN operatorprevious : nextThe jOOQ User Manual : DSL or fluent API : Nested select statements using the IN operatorprevious : next
- +
The jOOQ User Manual : DSL or fluent API : Other types of nested selectsprevious : nextThe jOOQ User Manual : DSL or fluent API : Other types of nested selectsprevious : next
- +
The jOOQ User Manual : DSL or fluent API : Stored procedures and functionsprevious : nextThe jOOQ User Manual : DSL or fluent API : Stored procedures and functionsprevious : next
- +
The jOOQ User Manual : DSL or fluent API : Complete SELECT syntaxprevious : nextThe jOOQ User Manual : DSL or fluent API : Complete SELECT syntaxprevious : next
- +
The jOOQ User Manual : DSL or fluent API : When it's just much easier: Plain SQLprevious : nextThe jOOQ User Manual : DSL or fluent API : When it's just much easier: Plain SQLprevious : next
- +
The jOOQ User Manual : DSL or fluent API : UNION and other set operationsprevious : nextThe jOOQ User Manual : DSL or fluent API : UNION and other set operationsprevious : next
- +
The jOOQ User Manual : DSL or fluent APIprevious : nextThe jOOQ User Manual : DSL or fluent APIprevious : next

Table of contents

  1. diff --git a/jOOQ-website/manual/JOOQ/ExampleDatabase/index.php b/jOOQ-website/manual/JOOQ/ExampleDatabase/index.php index e237975a69..7f133c9b49 100644 --- a/jOOQ-website/manual/JOOQ/ExampleDatabase/index.php +++ b/jOOQ-website/manual/JOOQ/ExampleDatabase/index.php @@ -18,7 +18,7 @@ function printContent() { ?> - +
    The jOOQ User Manual : jOOQ classes and their usage : The example databaseprevious : nextThe jOOQ User Manual : jOOQ classes and their usage : The example databaseprevious : next

    Example CREATE TABLE statements

    diff --git a/jOOQ-website/manual/JOOQ/Extend/index.php b/jOOQ-website/manual/JOOQ/Extend/index.php index 320a6d350e..59d5268cc2 100644 --- a/jOOQ-website/manual/JOOQ/Extend/index.php +++ b/jOOQ-website/manual/JOOQ/Extend/index.php @@ -14,7 +14,7 @@ function printContent() { ?> - +
    The jOOQ User Manual : jOOQ classes and their usage : Extend jOOQ types with custom implementationsprevious : nextThe jOOQ User Manual : jOOQ classes and their usage : Extend jOOQ types with custom implementationsprevious : next
    - +
    The jOOQ User Manual : jOOQ classes and their usage : The Factory classprevious : nextThe jOOQ User Manual : jOOQ classes and their usage : The Factory classprevious : next

    The Factory and the jOOQ API

    @@ -37,27 +37,27 @@ function printContent() {

    - The org.jooq.impl.Factory + The org.jooq.impl.Factory class is the main class from where you will create all jOOQ objects. - The Factory implements org.jooq.Configuration + The Factory implements org.jooq.Configuration and needs to be instanciated with the Configuration's properties:

    @@ -86,7 +86,7 @@ MySQLFactory create = new MySQLFactory(connection);

    + +
    jOOQ classes and their usage @@ -75,6 +77,8 @@ the way you're used to in SQL

    + +
    The example database @@ -135,6 +139,8 @@ CREATE TABLE t_book_to_book_store (

    + +
    The Factory class @@ -249,9 +255,140 @@ MySQLFactory create = new MySQLFactory(connection);

    + +
    Tables and Fields + + Tables and their Fields are probably the most important objects in + jOOQ. Tables represent any entity in your underlying RDBMS, that holds + data for selection, insertion, updates, and deletion. In other words, + views are also considered tables by jOOQ. + + +

    The Table

    +

    The formal definition of a starts with

    +
    public interface Table<R extends Record> // [...]
    +

    + This means that every table is associated with a subtype of the + + class (see also + + ). For anonymous or ad-hoc tables, + <R> will always bind to Record itself. +

    +

    + Unlike in the + JPA CriteriaQuery API, + this generic type + <R> + is not given so much importance as far as + type-safety is concerned. + SQL itself is inherently type-unsafe. But then + again, you have + incredible flexibility of creating anonymous or ad-hoc + types and + reusing them from + + or from many other + use-cases. If + <R> would play a role as important + as in JPA, jOOQ + would suffer from + the same verbosity, or inflexibility + that JPA + CriteriaQueries may + have. +

    + +

    The Field

    +

    The formal definition of a Field starts with

    +
    public interface Field<T> // [...]
    +

    + Fields are generically parameterised with a Java type + <T> + that reflects the closest match to the RDMBS's underlying datatype for that + field. For instance, if you have a VARCHAR2 type Field in Oracle, + <T> + would bind to + + for that Field in jOOQ. Oracle's NUMBER(7) would + let + <T> + bind to + , + etc. This generic type is useful for two purposes: +

    +
      +
    • It allows you to write type safe queries. For instance, you cannot + compare Field + <String> + with Field + <Integer>
    • + +
    • It + allows you to fetch correctly cast and converted values from + your database result set. This is especially useful when <T> binds + to + advanced data types, such as + + , where jOOQ + does the difficult non-standardised JDBC data type conversions for you. +
    • +
    + +

    Fields and tables put into action

    +

    The Field itself is a very broad concept. Other tools, or databases + refer to it as expression or column. When you just want to

    + +
    SELECT 1 FROM DUAL
    +

    + Then 1 is considered a Field or more explicitly, a + , + which implements Field, and DUAL is considered a Table or more explicitly + , which implements Table +

    +

    + More advanced uses become clear quickly, when you do things like +

    +
    SELECT 1 + 1 FROM DUAL
    +

    + Where 1 + 1 itself is a Field or more explicitly, an + + joining two Constants together. +

    +

    + See some details about how to create these queries in the + of the manual +

    + +

    TableFields

    +

    + A specific type of field is the + , + which represents a physical + Field in a physical Table. Both the + TableField and its referenced Table + know each other. The physical aspect + of their nature is represented in + jOOQ by + , + where every entity in your database + schema will be generated into a + corresponding Java class. +

    +

    + TableFields join both <R> and <T> generic parameters into their specification: +

    +
    public interface TableField<R extends Record, T> // [...]
    +

    + This can be used for additional type safety in the future, or by client code. +

    +
    + +
    Results and Records