Release 1.6.8

This commit is contained in:
Lukas Eder 2011-10-22 15:36:44 +00:00
parent c0c7e89a3e
commit 504ca26908
4 changed files with 68 additions and 114 deletions

View File

@ -1831,7 +1831,7 @@ CREATE OR REPLACE PROCEDURE p_author_exists_2 (author_name VARCHAR2, result OUT
<pre class="prettyprint lang-java">
// The function has a generic type parameter &lt;T&gt; bound to its return value
public class FAuthorExists extends StoredFunctionImpl&lt;BigDecimal&gt; {
public class FAuthorExists extends org.jooq.impl.AbstractRoutine&lt;BigDecimal&gt; {
// Much like Tables, functions have static parameter definitions
public static final Parameter&lt;String&gt; AUTHOR_NAME = // [...]
@ -1841,7 +1841,7 @@ public class FAuthorExists extends StoredFunctionImpl&lt;BigDecimal&gt; {
public void setAuthorName(Field&lt;String&gt; value) { // [...]
}
public class PAuthorExists extends StoredProcedureImpl {
public class PAuthorExists extends org.jooq.impl.AbstractRoutine&lt;java.lang.Void&gt; {
// In procedures, IN, OUT, IN OUT parameters are all represented
// as static parameter definitions as well
@ -1855,7 +1855,7 @@ public class PAuthorExists extends StoredProcedureImpl {
public BigDecimal getResult() { // [...]
}
public class PAuthorExists_2 extends StoredProcedureImpl {
public class PAuthorExists_2 extends org.jooq.impl.AbstractRoutine&lt;java.lang.Void&gt; {
public static final Parameter&lt;String&gt; AUTHOR_NAME = // [...]
public static final Parameter&lt;BigDecimal&gt; RESULT = // [...]
public static final Parameter&lt;BigDecimal&gt; ID = // [...]
@ -1878,8 +1878,8 @@ assertEquals(BigDecimal.ONE, p.getResult());</pre>
<p>If you use the generated convenience methods, however, things are much simpler, still: </p>
<pre class="prettyprint lang-java">
// Every schema has a single Functions class with convenience methods
public final class Functions {
// Every schema has a single Routines class with convenience methods
public final class Routines {
// Convenience method to directly call the stored function
public static BigDecimal fAuthorExists(Configuration configuration, String authorName) { // [...]
@ -1888,10 +1888,6 @@ public final class Functions {
// Field&lt;BigDecimal&gt;, such that it can be used in SQL
public static Field&lt;BigDecimal&gt; fAuthorExists(Field&lt;String&gt; authorName) { // [...]
public static Field&lt;BigDecimal&gt; fAuthorExists(String authorName) { // [...]
}
// Every schema has a single Procedures class with convenience methods
public final class Procedures {
// Procedures with 0 OUT parameters create void methods
// Procedures with 1 OUT parameter create methods as such:
@ -1909,39 +1905,18 @@ assertEquals(BigDecimal.ONE, Procedures.pAuthorExists(configuration, "Paulo"));<
<h3>jOOQ's understanding of procedures vs functions</h3>
<p>
It might not be very clear, what defines a procedure and what
defines a
function in those RDBMS that support these objects. Most
often, a function
has a mandatory return value, whereas procedures can
return OUT parameters.
Oracle allows for mixing those concepts.
Postgres omits the term procedure, etc.
jOOQ does not formally distinguish procedures from functions.
jOOQ only knows about routines, which can have return values
and/or OUT parameters. This is the best option to handle the
variety of stored procedure / function support across the
various supported RDBMS. For more details, read on about this
topic, here:
</p>
<p>
For jOOQ, the following applies:
</p>
<ul>
<li>
A procedure is an object that cannot be used in SQL (because it
has no
return value). A procedure is called internally by jOOQ using a
<a href="http://download.oracle.com/javase/6/docs/api/java/sql/CallableStatement.html" title="External API reference: java.sql.CallableStatement">java.sql.CallableStatement</a>
</li>
<li>
A function is an object that can be used in SQL. There is always
the
possibility to create a
<a href="https://github.com/lukaseder/jOOQ/blob/master/jOOQ/src/main/java/org/jooq/Field.java" title="Internal API reference: org.jooq.Field">org.jooq.Field</a>
to represent the function
embedded in SQL.
</li>
</ul>
<a href="http://lukaseder.wordpress.com/2011/10/17/what-are-procedures-and-functions-after-all/" title="Blog post about the difference between procedures and functions in various RDBMS">lukaseder.wordpress.com/2011/10/17/what-are-procedures-and-functions-after-all/</a>
</p>
<h3>Packages in Oracle</h3>
<p>
@ -3226,12 +3201,21 @@ Field&lt;Integer&gt; position(Field&lt;String&gt; search);</pre>
Field: </p>
<pre class="prettyprint lang-java">
// Every-day functions
Field&lt;Integer&gt; count();
Field&lt;Integer&gt; countDistinct();
Field&lt;T&gt; max();
Field&lt;T&gt; min();
Field&lt;BigDecimal&gt; sum();
Field&lt;BigDecimal&gt; avg();</pre>
Field&lt;BigDecimal&gt; avg();
// Statistical functions
Field&lt;BigDecimal&gt; median();
Field&lt;BigDecimal&lt; stddevPop();
Field&lt;BigDecimal&lt; stddevSamp();
Field&lt;BigDecimal&lt; varPop();
Field&lt;BigDecimal&lt; varSamp();
</pre>
<p>A typical example of how to use an aggregate operator is when
generating the next key on insertion of an ID. When you want to

View File

@ -68,12 +68,21 @@ Field&lt;Integer&gt; position(Field&lt;String&gt; search);</pre>
Field: </p>
<pre class="prettyprint lang-java">
// Every-day functions
Field&lt;Integer&gt; count();
Field&lt;Integer&gt; countDistinct();
Field&lt;T&gt; max();
Field&lt;T&gt; min();
Field&lt;BigDecimal&gt; sum();
Field&lt;BigDecimal&gt; avg();</pre>
Field&lt;BigDecimal&gt; avg();
// Statistical functions
Field&lt;BigDecimal&gt; median();
Field&lt;BigDecimal&lt; stddevPop();
Field&lt;BigDecimal&lt; stddevSamp();
Field&lt;BigDecimal&lt; varPop();
Field&lt;BigDecimal&lt; varSamp();
</pre>
<p>A typical example of how to use an aggregate operator is when
generating the next key on insertion of an ID. When you want to

View File

@ -64,7 +64,7 @@ CREATE OR REPLACE PROCEDURE p_author_exists_2 (author_name VARCHAR2, result OUT
<pre class="prettyprint lang-java">
// The function has a generic type parameter &lt;T&gt; bound to its return value
public class FAuthorExists extends StoredFunctionImpl&lt;BigDecimal&gt; {
public class FAuthorExists extends org.jooq.impl.AbstractRoutine&lt;BigDecimal&gt; {
// Much like Tables, functions have static parameter definitions
public static final Parameter&lt;String&gt; AUTHOR_NAME = // [...]
@ -74,7 +74,7 @@ public class FAuthorExists extends StoredFunctionImpl&lt;BigDecimal&gt; {
public void setAuthorName(Field&lt;String&gt; value) { // [...]
}
public class PAuthorExists extends StoredProcedureImpl {
public class PAuthorExists extends org.jooq.impl.AbstractRoutine&lt;java.lang.Void&gt; {
// In procedures, IN, OUT, IN OUT parameters are all represented
// as static parameter definitions as well
@ -88,7 +88,7 @@ public class PAuthorExists extends StoredProcedureImpl {
public BigDecimal getResult() { // [...]
}
public class PAuthorExists_2 extends StoredProcedureImpl {
public class PAuthorExists_2 extends org.jooq.impl.AbstractRoutine&lt;java.lang.Void&gt; {
public static final Parameter&lt;String&gt; AUTHOR_NAME = // [...]
public static final Parameter&lt;BigDecimal&gt; RESULT = // [...]
public static final Parameter&lt;BigDecimal&gt; ID = // [...]
@ -111,8 +111,8 @@ assertEquals(BigDecimal.ONE, p.getResult());</pre>
<p>If you use the generated convenience methods, however, things are much simpler, still: </p>
<pre class="prettyprint lang-java">
// Every schema has a single Functions class with convenience methods
public final class Functions {
// Every schema has a single Routines class with convenience methods
public final class Routines {
// Convenience method to directly call the stored function
public static BigDecimal fAuthorExists(Configuration configuration, String authorName) { // [...]
@ -121,10 +121,6 @@ public final class Functions {
// Field&lt;BigDecimal&gt;, such that it can be used in SQL
public static Field&lt;BigDecimal&gt; fAuthorExists(Field&lt;String&gt; authorName) { // [...]
public static Field&lt;BigDecimal&gt; fAuthorExists(String authorName) { // [...]
}
// Every schema has a single Procedures class with convenience methods
public final class Procedures {
// Procedures with 0 OUT parameters create void methods
// Procedures with 1 OUT parameter create methods as such:
@ -142,39 +138,18 @@ assertEquals(BigDecimal.ONE, Procedures.pAuthorExists(configuration, "Paulo"));<
<h3>jOOQ's understanding of procedures vs functions</h3>
<p>
It might not be very clear, what defines a procedure and what
defines a
function in those RDBMS that support these objects. Most
often, a function
has a mandatory return value, whereas procedures can
return OUT parameters.
Oracle allows for mixing those concepts.
Postgres omits the term procedure, etc.
jOOQ does not formally distinguish procedures from functions.
jOOQ only knows about routines, which can have return values
and/or OUT parameters. This is the best option to handle the
variety of stored procedure / function support across the
various supported RDBMS. For more details, read on about this
topic, here:
</p>
<p>
For jOOQ, the following applies:
</p>
<ul>
<li>
A procedure is an object that cannot be used in SQL (because it
has no
return value). A procedure is called internally by jOOQ using a
<a href="http://download.oracle.com/javase/6/docs/api/java/sql/CallableStatement.html" title="External API reference: java.sql.CallableStatement">java.sql.CallableStatement</a>
</li>
<li>
A function is an object that can be used in SQL. There is always
the
possibility to create a
<a href="https://github.com/lukaseder/jOOQ/blob/master/jOOQ/src/main/java/org/jooq/Field.java" title="Internal API reference: org.jooq.Field">org.jooq.Field</a>
to represent the function
embedded in SQL.
</li>
</ul>
<a href="http://lukaseder.wordpress.com/2011/10/17/what-are-procedures-and-functions-after-all/" title="Blog post about the difference between procedures and functions in various RDBMS">lukaseder.wordpress.com/2011/10/17/what-are-procedures-and-functions-after-all/</a>
</p>
<h3>Packages in Oracle</h3>
<p>

View File

@ -1650,7 +1650,7 @@ CREATE OR REPLACE PROCEDURE p_author_exists_2 (author_name VARCHAR2, result OUT
<java>
// The function has a generic type parameter &lt;T&gt; bound to its return value
public class FAuthorExists extends StoredFunctionImpl&lt;BigDecimal&gt; {
public class FAuthorExists extends org.jooq.impl.AbstractRoutine&lt;BigDecimal&gt; {
// Much like Tables, functions have static parameter definitions
public static final Parameter&lt;String&gt; AUTHOR_NAME = // [...]
@ -1660,7 +1660,7 @@ public class FAuthorExists extends StoredFunctionImpl&lt;BigDecimal&gt; {
public void setAuthorName(Field&lt;String&gt; value) { // [...]
}
public class PAuthorExists extends StoredProcedureImpl {
public class PAuthorExists extends org.jooq.impl.AbstractRoutine&lt;java.lang.Void&gt; {
// In procedures, IN, OUT, IN OUT parameters are all represented
// as static parameter definitions as well
@ -1674,7 +1674,7 @@ public class PAuthorExists extends StoredProcedureImpl {
public BigDecimal getResult() { // [...]
}
public class PAuthorExists_2 extends StoredProcedureImpl {
public class PAuthorExists_2 extends org.jooq.impl.AbstractRoutine&lt;java.lang.Void&gt; {
public static final Parameter&lt;String&gt; AUTHOR_NAME = // [...]
public static final Parameter&lt;BigDecimal&gt; RESULT = // [...]
public static final Parameter&lt;BigDecimal&gt; ID = // [...]
@ -1697,8 +1697,8 @@ assertEquals(BigDecimal.ONE, p.getResult());</java>
<p>If you use the generated convenience methods, however, things are much simpler, still: </p>
<java>
// Every schema has a single Functions class with convenience methods
public final class Functions {
// Every schema has a single Routines class with convenience methods
public final class Routines {
// Convenience method to directly call the stored function
public static BigDecimal fAuthorExists(Configuration configuration, String authorName) { // [...]
@ -1707,10 +1707,6 @@ public final class Functions {
// Field&lt;BigDecimal&gt;, such that it can be used in SQL
public static Field&lt;BigDecimal&gt; fAuthorExists(Field&lt;String&gt; authorName) { // [...]
public static Field&lt;BigDecimal&gt; fAuthorExists(String authorName) { // [...]
}
// Every schema has a single Procedures class with convenience methods
public final class Procedures {
// Procedures with 0 OUT parameters create void methods
// Procedures with 1 OUT parameter create methods as such:
@ -1728,35 +1724,16 @@ assertEquals(BigDecimal.ONE, Procedures.pAuthorExists(configuration, "Paulo"));<
<h3>jOOQ's understanding of procedures vs functions</h3>
<p>
It might not be very clear, what defines a procedure and what
defines a
function in those RDBMS that support these objects. Most
often, a function
has a mandatory return value, whereas procedures can
return OUT parameters.
Oracle allows for mixing those concepts.
Postgres omits the term procedure, etc.
jOOQ does not formally distinguish procedures from functions.
jOOQ only knows about routines, which can have return values
and/or OUT parameters. This is the best option to handle the
variety of stored procedure / function support across the
various supported RDBMS. For more details, read on about this
topic, here:
</p>
<p>
For jOOQ, the following applies:
<a href="http://lukaseder.wordpress.com/2011/10/17/what-are-procedures-and-functions-after-all/" title="Blog post about the difference between procedures and functions in various RDBMS">lukaseder.wordpress.com/2011/10/17/what-are-procedures-and-functions-after-all/</a>
</p>
<ul>
<li>
A procedure is an object that cannot be used in SQL (because it
has no
return value). A procedure is called internally by jOOQ using a
<reference class="java.sql.CallableStatement" />
</li>
<li>
A function is an object that can be used in SQL. There is always
the
possibility to create a
<reference class="org.jooq.Field" />
to represent the function
embedded in SQL.
</li>
</ul>
<h3>Packages in Oracle</h3>
<p>
@ -3023,12 +3000,21 @@ Field&lt;Integer&gt; position(Field&lt;String&gt; search);</java>
Field: </p>
<java>
// Every-day functions
Field&lt;Integer&gt; count();
Field&lt;Integer&gt; countDistinct();
Field&lt;T&gt; max();
Field&lt;T&gt; min();
Field&lt;BigDecimal&gt; sum();
Field&lt;BigDecimal&gt; avg();</java>
Field&lt;BigDecimal&gt; avg();
// Statistical functions
Field&lt;BigDecimal&gt; median();
Field&lt;BigDecimal&lt; stddevPop();
Field&lt;BigDecimal&lt; stddevSamp();
Field&lt;BigDecimal&lt; varPop();
Field&lt;BigDecimal&lt; varSamp();
</java>
<p>A typical example of how to use an aggregate operator is when
generating the next key on insertion of an ID. When you want to