Added some sections to the manual

This commit is contained in:
Lukas Eder 2011-09-17 14:17:28 +00:00
parent 13943d1fbc
commit 4cc15e7dda
6 changed files with 196 additions and 19 deletions

View File

@ -1,12 +1,16 @@
<?php
require 'frame.php';
function printH1() {
print 'Be part of jOOQ!';
print 'Be part of jOOQ!<br/>Become a jOOQer';
}
function getSlogan() {
return "jOOQ can only be as great as its community. You can make the change happen! jOOQ needs
motivated staff, providing new database integrations, website translations, and shouting out to
the world about jOOQ. You have a blog? Write about jOOQ in your language!";
}
function getSlogan() {}
function printContent() {
?>
<h2>Be a jOOQ contributor!</h2>
<h2>The hall of fame</h2>
<p>jOOQ needs your help to implement all of this and more! Make it to the hall of fame of jOOQ contributors:</p>
<ul>
<li>Lukas Eder: Project lead</li>
@ -18,8 +22,9 @@ function printContent() {
</ul>
<p>Thanks to all of the above people!</p>
<h2>Instructions</h2>
<p>You can contribute anything. Ideas, feature requests or bug reports (please use trac, and be explicit). Or code! If you want to share code, please follow these instructions</p>
<h2>Contribution instructions</h2>
<p>You can contribute anything. Ideas, feature requests or bug reports (please use trac, and be explicit). You can also help enlarge the community, by shouting out to the world about jOOQ and how you use it. You have a blog? Write about jOOQ!</p>
<p>Or contribute code! If you want to share code, please follow these instructions</p>
<ul>
<li>Check out the codebase from sourceforge: <a href="https://sourceforge.net/scm/?type=svn&group_id=283484" title="jOOQ SVN repository">SVN</a>. <a href="https://github.com/lukaseder/jOOQ" title="jOOQ GitHub repository">GitHub</a> is also available but may be incomplete</li>
<li>Import the five jOOQ projects into <a href="http://www.eclipse.org/" title="jOOQ developers use Eclipse">Eclipse</a></li>
@ -37,7 +42,7 @@ function printContent() {
<li>If you are a committer on sourceforge, please commit with the following comment scheme: <br/>[#Trac-ID] Trac-Ticket-Title - Your specific comment</li>
</ul>
<h2>Hints</h2>
<h2>Hints for new database integrations</h2>
<p>Should you wish to provide an extension/support for a new RDBMS (such as Informix, Firebird, etc) your work would consist of these steps:</p>
<ul>

View File

@ -1,18 +1,23 @@
<?php
require 'frame.php';
function printH1() {
print 'Useful links for jOOQ';
print 'Useful links for jOOQ users and developers';
}
function getSlogan() {
return "You've come far in your search of more intuitive integration of SQL and Java.
Here you will find further resources related to jOOQ, to similar products and
other inspiration related to jOOQ";
}
function getSlogan() {}
function printContent() {
global $root;
?>
<h2>NEWS</h2>
<h2>jOOQ news groups</h2>
<ul>
<li>Subscribe to the <a href="http://groups.google.com/group/jooq-user">jOOQ User Group</a></li>
<li>Subscribe to the <a href="http://groups.google.com/group/jooq-developer">jOOQ Developer Group</a></li>
</ul>
<h2>Follow jOOQ</h2>
<h2>jOOQ in the WWW</h2>
<ul>
<li>On Wordpress: <a href="http://lukaseder.wordpress.com/" title="Lukas Eder's blog about Java, SQL and jOOQ">http://lukaseder.wordpress.com/</a></li>
<li>On SourceForge: <a href="https://sourceforge.net/projects/jooq/" title="jOOQ download and hosting on source forge">https://sourceforge.net/projects/jooq/</a></li>
@ -22,7 +27,7 @@ function printContent() {
<li>On Stack Overflow: <a href="http://stackoverflow.com/questions/tagged/jooq" title="ask questions about jOOQ on Stack Overflow">http://stackoverflow.com/questions/tagged/jooq</a></li>
</ul>
<h2>Similar products</h2>
<h2>jOOQ's source of inspiration, similar products</h2>
<p>When you consider jOOQ for your project, you might also have considered any of these similar products:</p>
<ul>
@ -42,11 +47,11 @@ function printContent() {
<li><a href="http://www.oracle.com/technetwork/java/javaee/tech/persistence-jsp-140049.html" title="QueryDSL, a product similar to jOOQ">JPA</a>: The J2EE standard</li>
</ul>
<h2>Other tools</h2>
<h2>jOOQ's little sister</h2>
<div style="height: 100px;">
<a href="http://code.google.com/p/joox/"
title="jOOX, a product inspired by jOOQ">
<img src="<?=root?>/img/joox-small.png" alt="jOOX" style="float:left; margin-right: 4em; border: 0"/></a>
<img src="<?=$root?>/img/joox-small.png" alt="jOOX" style="float:left; margin-right: 4em; border: 0"/></a>
<p><a href="http://code.google.com/p/joox/"
title="jOOX, a product inspired by jOOQ">jOOX</a> stands for Java
Object Oriented XML. It is a simple wrapper for the org.w3c.dom package,

View File

@ -14,7 +14,7 @@ function printContent() {
?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td align="left" valign="top"><a href="<?=$root?>/manual/">The jOOQ User Manual</a> : <a href="<?=$root?>/manual/ADVANCED/">Advanced topics</a></td><td align="right" valign="top" style="white-space: nowrap"><a href="<?=$root?>/manual/DSL/SQL/" title="When it's just much easier: Plain SQL">previous</a> : <a href="<?=$root?>/manual/ADVANCED/MasterData/" title="Master data generation">next</a></td>
<td align="left" valign="top"><a href="<?=$root?>/manual/">The jOOQ User Manual</a> : <a href="<?=$root?>/manual/ADVANCED/">Advanced topics</a></td><td align="right" valign="top" style="white-space: nowrap"><a href="<?=$root?>/manual/DSL/SQL/" title="Previous section: When it's just much easier: Plain SQL">previous</a> : <a href="<?=$root?>/manual/ADVANCED/MasterData/" title="Next section: Master data generation">next</a></td>
</tr>
</table><h3>Table of contents</h3><ol>
<li>

View File

@ -7,7 +7,12 @@ function printH1() {
print "Results and Records";
}
function getSlogan() {
return "";
return "
Results and their Records come into play, when SELECT statements are
executed. There are various ways to fetch data from a jOOQ SELECT
statement. Essentially, the query results are always provided in the
Result API
";
}
function printContent() {
global $root;
@ -16,8 +21,82 @@ function printContent() {
<tr>
<td align="left" valign="top"><a href="<?=$root?>/manual/">The jOOQ User Manual</a> : <a href="<?=$root?>/manual/JOOQ/">jOOQ classes and their usage</a> : <a href="<?=$root?>/manual/JOOQ/Result/">Results and Records</a></td><td align="right" valign="top" style="white-space: nowrap"><a href="<?=$root?>/manual/JOOQ/Table/" title="Previous section: Tables and Fields">previous</a> : <a href="<?=$root?>/manual/JOOQ/UpdatableRecord/" title="Next section: Updatable Records">next</a></td>
</tr>
</table>
</table>
<h2>The Result</h2>
<p>
The
<a href="https://github.com/lukaseder/jOOQ/blob/master/jOOQ/src/main/java/org/jooq/Result.java" title="Internal API reference: org.jooq.Result">Result</a>&lt;R extends <a href="https://github.com/lukaseder/jOOQ/blob/master/jOOQ/src/main/java/org/jooq/Record.java" title="Internal API reference: org.jooq.Record">Record</a>&gt;
is essentially a wrapper for a List&lt;R extends Record&gt;
providing
many convenience methods for accessing single elements in
the result
set. Depending on the type of SELECT statement,
&lt;R&gt; can be bound
to a sub-type of Record, for instance to an
<a href="https://github.com/lukaseder/jOOQ/blob/master/jOOQ/src/main/java/org/jooq/UpdatableRecord.java" title="Internal API reference: org.jooq.UpdatableRecord">org.jooq.UpdatableRecord</a>.
See the section on
<a href="<?=$root?>/manual/JOOQ/UpdatableRecord/" title="jOOQ Manual reference: Updatable Records">Updatable Records</a>
for further details.
</p>
<h2>The Cursor</h2>
<p>
A similar object is the
<a href="https://github.com/lukaseder/jOOQ/blob/master/jOOQ/src/main/java/org/jooq/Cursor.java" title="Internal API reference: org.jooq.Cursor">Cursor</a>&lt;R extends Record&gt;.
Unlike the Result, the cursor has not fetched all data from the database yet.
This means, you save memory (and potentially speed), but you can only access
data sequentially and you have to keep a JDBC ResultSet alive. Cursors behave
very much like the <a href="http://download.oracle.com/javase/6/docs/api/java/util/Iterator.html" title="External API reference: java.util.Iterator">java.util.Iterator</a>,
by providing a very simple API:
</p>
<pre class="prettyprint lang-java">
// Check whether there are any more records to be fetched
boolean hasNext() throws SQLException;
// Fetch the next record from the underlying JDBC ResultSet
R fetchOne() throws SQLException;
// Close the underlying JDBC ResultSet. Don't forget to call this, before disposing the Cursor.
void close() throws SQLException;</pre>
<h2>The Record</h2>
<p>
The Record itself holds all the data from your selected tuple. If it is
a <a href="https://github.com/lukaseder/jOOQ/blob/master/jOOQ/src/main/java/org/jooq/TableRecord.java" title="Internal API reference: org.jooq.TableRecord">org.jooq.TableRecord</a>, then it corresponds exactly to the type of one of your
physical tables in your database. But any anonymous or ad-hoc tuple can
be represented by the plain Record. A record mainly provides access to
its data and adds convenience methods for data type conversion. These
are the main access ways:
</p>
<pre class="prettyprint lang-java">
// If you can keep a reference of the selected field, then you can get the corresponding value type-safely
&lt;T&gt; T getValue(Field&lt;T&gt; field);
// If you know the name of the selected field within the tuple,
// then you can get its value without any type information
Object getValue(String fieldName);
// If you know the index of the selected field within the tuple,
// then you can get its value without any type information
Object getValue(int index);</pre>
<p>
In some cases, you will not be able to reference the selected Fields
both when you create the SELECT statement and when you fetch data from
Records. Then you might use field names or indexes, as with JDBC.
However, of course, the type information will then be lost as well. If
you know what type you want to get, you can always use the Record's
convenience methods for type conversion, however. Some examples:
</p>
<pre class="prettyprint lang-java">
// These methods will try to convert a value to a BigDecimal.
// This will work for all numeric types and for CHAR/VARCHAR types, if they contain numeric values:
BigDecimal getValueAsBigDecimal(String fieldName);
BigDecimal getValueAsBigDecimal(int fieldIndex);
// This method can perform arbitrary conversions
&lt;T&gt; T getValue(String fieldName, Class&lt;? extends T&gt; type);
&lt;T&gt; T getValue(int fieldIndex, Class&lt;? extends T&gt; type);</pre>
<?php
}
?>

View File

@ -1,9 +1,13 @@
<?php
require 'frame.php';
function printH1() {
print 'The history of jOOQ';
print 'The history of jOOQ<br/>From 2009 to ' . date('Y');
}
function getSlogan() {
return "jOOQ has come a long way. The community is growing as features are being added
in the beginning, jOOQ was no more than type-safe querying for simple statements. See how
jOOQ is growing to support almost all SQL constructs by 12 different RDBMS";
}
function getSlogan() {}
function printContent() {
$contents = file('inc/RELEASENOTES.txt');

View File

@ -391,7 +391,91 @@ MySQLFactory create = new MySQLFactory(connection);
<section id="Result">
<title>Results and Records</title>
<slogan>
Results and their Records come into play, when SELECT statements are
executed. There are various ways to fetch data from a jOOQ SELECT
statement. Essentially, the query results are always provided in the
Result API
</slogan>
<content>
<h2>The Result</h2>
<p>
The
<reference class="org.jooq.Result" title="Result" />&lt;R extends <reference class="org.jooq.Record" title="Record" />&gt;
is essentially a wrapper for a List&lt;R extends Record&gt;
providing
many convenience methods for accessing single elements in
the result
set. Depending on the type of SELECT statement,
&lt;R&gt; can be bound
to a sub-type of Record, for instance to an
<reference class="org.jooq.UpdatableRecord" />.
See the section on
<reference id="UpdatableRecord" title="Updatable Records" />
for further details.
</p>
<h2>The Cursor</h2>
<p>
A similar object is the
<reference class="org.jooq.Cursor" title="Cursor"/>&lt;R extends Record&gt;.
Unlike the Result, the cursor has not fetched all data from the database yet.
This means, you save memory (and potentially speed), but you can only access
data sequentially and you have to keep a JDBC ResultSet alive. Cursors behave
very much like the <reference class="java.util.Iterator"/>,
by providing a very simple API:
</p>
<pre class="prettyprint lang-java">
// Check whether there are any more records to be fetched
boolean hasNext() throws SQLException;
// Fetch the next record from the underlying JDBC ResultSet
R fetchOne() throws SQLException;
// Close the underlying JDBC ResultSet. Don't forget to call this, before disposing the Cursor.
void close() throws SQLException;</pre>
<h2>The Record</h2>
<p>
The Record itself holds all the data from your selected tuple. If it is
a <reference class="org.jooq.TableRecord"/>, then it corresponds exactly to the type of one of your
physical tables in your database. But any anonymous or ad-hoc tuple can
be represented by the plain Record. A record mainly provides access to
its data and adds convenience methods for data type conversion. These
are the main access ways:
</p>
<pre class="prettyprint lang-java">
// If you can keep a reference of the selected field, then you can get the corresponding value type-safely
&lt;T&gt; T getValue(Field&lt;T&gt; field);
// If you know the name of the selected field within the tuple,
// then you can get its value without any type information
Object getValue(String fieldName);
// If you know the index of the selected field within the tuple,
// then you can get its value without any type information
Object getValue(int index);</pre>
<p>
In some cases, you will not be able to reference the selected Fields
both when you create the SELECT statement and when you fetch data from
Records. Then you might use field names or indexes, as with JDBC.
However, of course, the type information will then be lost as well. If
you know what type you want to get, you can always use the Record's
convenience methods for type conversion, however. Some examples:
</p>
<pre class="prettyprint lang-java">
// These methods will try to convert a value to a BigDecimal.
// This will work for all numeric types and for CHAR/VARCHAR types, if they contain numeric values:
BigDecimal getValueAsBigDecimal(String fieldName);
BigDecimal getValueAsBigDecimal(int fieldIndex);
// This method can perform arbitrary conversions
&lt;T&gt; T getValue(String fieldName, Class&lt;? extends T&gt; type);
&lt;T&gt; T getValue(int fieldIndex, Class&lt;? extends T&gt; type);</pre>
</content>
</section>
<section id="UpdatableRecord">
<title>Updatable Records</title>
</section>