Release 1.6.8
This commit is contained in:
parent
c0c7e89a3e
commit
504ca26908
@ -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 <T> bound to its return value
|
||||
public class FAuthorExists extends StoredFunctionImpl<BigDecimal> {
|
||||
public class FAuthorExists extends org.jooq.impl.AbstractRoutine<BigDecimal> {
|
||||
|
||||
// Much like Tables, functions have static parameter definitions
|
||||
public static final Parameter<String> AUTHOR_NAME = // [...]
|
||||
@ -1841,7 +1841,7 @@ public class FAuthorExists extends StoredFunctionImpl<BigDecimal> {
|
||||
public void setAuthorName(Field<String> value) { // [...]
|
||||
}
|
||||
|
||||
public class PAuthorExists extends StoredProcedureImpl {
|
||||
public class PAuthorExists extends org.jooq.impl.AbstractRoutine<java.lang.Void> {
|
||||
|
||||
// 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<java.lang.Void> {
|
||||
public static final Parameter<String> AUTHOR_NAME = // [...]
|
||||
public static final Parameter<BigDecimal> RESULT = // [...]
|
||||
public static final Parameter<BigDecimal> 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<BigDecimal>, such that it can be used in SQL
|
||||
public static Field<BigDecimal> fAuthorExists(Field<String> authorName) { // [...]
|
||||
public static Field<BigDecimal> 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<Integer> position(Field<String> search);</pre>
|
||||
Field: </p>
|
||||
|
||||
<pre class="prettyprint lang-java">
|
||||
// Every-day functions
|
||||
Field<Integer> count();
|
||||
Field<Integer> countDistinct();
|
||||
Field<T> max();
|
||||
Field<T> min();
|
||||
Field<BigDecimal> sum();
|
||||
Field<BigDecimal> avg();</pre>
|
||||
Field<BigDecimal> avg();
|
||||
|
||||
// Statistical functions
|
||||
Field<BigDecimal> median();
|
||||
Field<BigDecimal< stddevPop();
|
||||
Field<BigDecimal< stddevSamp();
|
||||
Field<BigDecimal< varPop();
|
||||
Field<BigDecimal< 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
|
||||
|
||||
@ -68,12 +68,21 @@ Field<Integer> position(Field<String> search);</pre>
|
||||
Field: </p>
|
||||
|
||||
<pre class="prettyprint lang-java">
|
||||
// Every-day functions
|
||||
Field<Integer> count();
|
||||
Field<Integer> countDistinct();
|
||||
Field<T> max();
|
||||
Field<T> min();
|
||||
Field<BigDecimal> sum();
|
||||
Field<BigDecimal> avg();</pre>
|
||||
Field<BigDecimal> avg();
|
||||
|
||||
// Statistical functions
|
||||
Field<BigDecimal> median();
|
||||
Field<BigDecimal< stddevPop();
|
||||
Field<BigDecimal< stddevSamp();
|
||||
Field<BigDecimal< varPop();
|
||||
Field<BigDecimal< 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
|
||||
|
||||
@ -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 <T> bound to its return value
|
||||
public class FAuthorExists extends StoredFunctionImpl<BigDecimal> {
|
||||
public class FAuthorExists extends org.jooq.impl.AbstractRoutine<BigDecimal> {
|
||||
|
||||
// Much like Tables, functions have static parameter definitions
|
||||
public static final Parameter<String> AUTHOR_NAME = // [...]
|
||||
@ -74,7 +74,7 @@ public class FAuthorExists extends StoredFunctionImpl<BigDecimal> {
|
||||
public void setAuthorName(Field<String> value) { // [...]
|
||||
}
|
||||
|
||||
public class PAuthorExists extends StoredProcedureImpl {
|
||||
public class PAuthorExists extends org.jooq.impl.AbstractRoutine<java.lang.Void> {
|
||||
|
||||
// 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<java.lang.Void> {
|
||||
public static final Parameter<String> AUTHOR_NAME = // [...]
|
||||
public static final Parameter<BigDecimal> RESULT = // [...]
|
||||
public static final Parameter<BigDecimal> 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<BigDecimal>, such that it can be used in SQL
|
||||
public static Field<BigDecimal> fAuthorExists(Field<String> authorName) { // [...]
|
||||
public static Field<BigDecimal> 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>
|
||||
|
||||
@ -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 <T> bound to its return value
|
||||
public class FAuthorExists extends StoredFunctionImpl<BigDecimal> {
|
||||
public class FAuthorExists extends org.jooq.impl.AbstractRoutine<BigDecimal> {
|
||||
|
||||
// Much like Tables, functions have static parameter definitions
|
||||
public static final Parameter<String> AUTHOR_NAME = // [...]
|
||||
@ -1660,7 +1660,7 @@ public class FAuthorExists extends StoredFunctionImpl<BigDecimal> {
|
||||
public void setAuthorName(Field<String> value) { // [...]
|
||||
}
|
||||
|
||||
public class PAuthorExists extends StoredProcedureImpl {
|
||||
public class PAuthorExists extends org.jooq.impl.AbstractRoutine<java.lang.Void> {
|
||||
|
||||
// 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<java.lang.Void> {
|
||||
public static final Parameter<String> AUTHOR_NAME = // [...]
|
||||
public static final Parameter<BigDecimal> RESULT = // [...]
|
||||
public static final Parameter<BigDecimal> 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<BigDecimal>, such that it can be used in SQL
|
||||
public static Field<BigDecimal> fAuthorExists(Field<String> authorName) { // [...]
|
||||
public static Field<BigDecimal> 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<Integer> position(Field<String> search);</java>
|
||||
Field: </p>
|
||||
|
||||
<java>
|
||||
// Every-day functions
|
||||
Field<Integer> count();
|
||||
Field<Integer> countDistinct();
|
||||
Field<T> max();
|
||||
Field<T> min();
|
||||
Field<BigDecimal> sum();
|
||||
Field<BigDecimal> avg();</java>
|
||||
Field<BigDecimal> avg();
|
||||
|
||||
// Statistical functions
|
||||
Field<BigDecimal> median();
|
||||
Field<BigDecimal< stddevPop();
|
||||
Field<BigDecimal< stddevSamp();
|
||||
Field<BigDecimal< varPop();
|
||||
Field<BigDecimal< 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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user