From 6a1f8faffcfe696b9782d19e8aaeb9deb194ac1f Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Sat, 25 Aug 2012 19:24:01 +0200 Subject: [PATCH] [#1657] Reorganise the manual (171 / 171) --- .../src/main/resources/manual-2.5.xml | 248 ++++++++++++++++-- 1 file changed, 229 insertions(+), 19 deletions(-) diff --git a/jOOQ-website/src/main/resources/manual-2.5.xml b/jOOQ-website/src/main/resources/manual-2.5.xml index f135c4bc1b..f63eabe089 100644 --- a/jOOQ-website/src/main/resources/manual-2.5.xml +++ b/jOOQ-website/src/main/resources/manual-2.5.xml @@ -8066,12 +8066,95 @@ public class Book implements java.io.Serializable
Generated procedures - + +

Generated procedures or functions

+

+ Every procedure or function (routine) in your database will generate a implementation that looks like this: +

+ + { + + // All IN, IN OUT, OUT parameters and function return values generate a static member + public static final Parameter AUTHOR_NAME = createParameter("AUTHOR_NAME", SQLDataType.VARCHAR); + public static final Parameter RESULT = createParameter("RESULT", SQLDataType.NUMERIC); + + // A constructor for a new "empty" procedure call + public AuthorExists() { + super("AUTHOR_EXISTS", TEST); + + addInParameter(AUTHOR_NAME); + addOutParameter(RESULT); + } + + // Every IN and IN OUT parameter generates a setter + public void setAuthorName(String value) { + setValue(AUTHOR_NAME, value); + } + + // Every IN OUT, OUT and RETURN_VALUE generates a getter + public BigDecimal getResult() { + return getValue(RESULT); + } + + // [...] +}]]> + +

Package and member procedures or functions

+

+ Procedures or functions contained in packages or UDTs are generated in a sub-package that corresponds to the package or UDT name. +

+ +

Flags controlling routine generation

+

+ Routine generation cannot be deactivated +

+
Generated UDTs - + +

Generated UDTs

+

+ Every UDT in your database will generate a implementation that looks like this: +

+ + { + + // The singleton UDT instance + public static final UAddressType U_ADDRESS_TYPE = new UAddressType(); + + // Every UDT attribute generates a static member + public static final UDTField ZIP = createField("ZIP", SQLDataType.VARCHAR, U_ADDRESS_TYPE); + public static final UDTField CITY = createField("CITY", SQLDataType.VARCHAR, U_ADDRESS_TYPE); + public static final UDTField COUNTRY = createField("COUNTRY", SQLDataType.VARCHAR, U_ADDRESS_TYPE); + + // [...] +}]]> + +

+ Besides the implementation, a implementation is also generated +

+ + { + + // Every attribute generates a getter and a setter + + public void setZip(String value) {...} + public String getZip() {...} + public void setCity(String value) {...} + public String getCity() {...} + public void setCountry(String value) {...} + public String getCountry() {...} + + // [...] +}]]> + +

Flags controlling UDT generation

+

+ UDT generation cannot be deactivated +

+
@@ -8268,36 +8351,163 @@ create.selectFrom(AUTHOR)
Tools - + +

Tools used with jOOQ

+

+ These chapters hold some information about tools to be used with jOOQ +

+
jOOQ Console - + +

jOOQ Console

+

+ The was driven by a feature request by Christopher Deckers, who has had the courtesy to contribute the jOOQ Console, a sample application interfacing with jOOQ's ExecuteListeners. The jOOQ Console logs all queries executed by jOOQ and displays them nicely in a Swing application. With the jOOQ Console's logger, you can: +

+
    +
  • Activate the console's DebugListener anytime (in-process or if the remote server is active).
  • +
  • View simple and batch queries and their parameters.
  • +
  • Reformat queries along with syntax highlighting for better readability.
  • +
  • View stack trace of originator of the call.
  • +
  • Dump the stack to stdout when in an IDE, to directly navigate to relevant classes.
  • +
  • Track execution time, binding time, parsing time, rows read, fields read.
  • +
  • Show/hide queries depending on their type (SELECT, UPDATE, etc.).
  • +
  • Sort any column (timing columns, queries, types, etc.)
  • +
  • Easy copy paste of rows/columns to Spreadsheet editors.
  • +
- -
- Logger - -
+

+ A short overview of such a debugging session can be seen here: +

+
+ jOOQ Console example +
+

+ Please note that the jOOQ Console is still experimental. Any feedback is very welcome on
+ the jooq-user group +

-
- Debugger - -
+

jOOQ Console operation modes

+

+ The jOOQ Console can be run in two different modes: +

+
    +
  • In-process mode: running in the same process as the queries you're analysing
  • +
  • "headless" mode: running remotely
  • +
-
- Editor - -
-
+

+ Both modes will require that you set the in the Factory's settings. When using XML settings: +

+ + + + org.jooq.debug.DebugListener + +]]> + +

+ Or when using programmatic settings: +

+ + + +

In-process mode

+

+ The in-process mode is useful for Swing applications or other, locally run Java programs accessing the database via jOOQ. In order to launch the jOOQ Console "in-process", specify the previously documented settings and launch the Console as follows: +

+ + + +

+ Only in the in-process mode, you can execute ad-hoc queries directly from the console, if you provide it with proper DatabaseDescriptor. These queries are executed from the Editor pane which features: +

+
    +
  • SQL editing within the console.
  • +
  • Incremental search on tables.
  • +
  • Simple code completion with tables/columns/SQL keywords.
  • +
  • Syntax highlighting and formatting capabilities.
  • +
  • Results shown in one or several tabs.
  • +
  • Easy analysis of Logger output by copy/pasting/running queries in the Editor.
  • +
+
+ jOOQ Console example +
+ +

"Headless" mode

+

+ In J2EE or other server/client environments, you may not be able to run the console in the same process as your application. You can then run the jOOQ Console in "headless" mode. In addition to the previously documented settings, you'll have to start a debugger server in your application process, that the console can connect to: +

+ +// Create a new RemoteDebuggerServer in your application that listens to +// incoming connections on a given port +SERVER = new RemoteDebuggerServer(DEBUGGER_PORT); + +

+ Now start your application along with the debugger server and launch the console with this command: +

+ +java -jar jooq-console-2.1.0.jar [host] [port] + +

+ Depending on your distribution, you may have to manually add rsyntaxtextarea-1.5.0.jar and jOOQ artefacts on your classpath. +

+
Reference - + +

General jOOQ reference

+

+ These chapters hold some general jOOQ reference information +

+