db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chaa...@apache.org
Subject svn commit: r1531025 - in /db/derby/docs/trunk/src/ref: refderby.ditamap rrefcreatefunctionstatement.dita rrefcreateprocedurestatement.dita rrefsqljcreateaggregate.dita rrefsqljcreatetype.dita rrefsqljexternalname.dita
Date Thu, 10 Oct 2013 15:29:28 GMT
Author: chaase3
Date: Thu Oct 10 15:29:27 2013
New Revision: 1531025

URL: http://svn.apache.org/r1531025
Log:
DERBY-6120  Clarify that $ is the separator character which should be used for 
the external names of static nested classes

Added a topic to the Reference manual, modified 4 other topics and the map file.

Patch: DERBY-6120.diff

Added:
    db/derby/docs/trunk/src/ref/rrefsqljexternalname.dita   (with props)
Modified:
    db/derby/docs/trunk/src/ref/refderby.ditamap
    db/derby/docs/trunk/src/ref/rrefcreatefunctionstatement.dita
    db/derby/docs/trunk/src/ref/rrefcreateprocedurestatement.dita
    db/derby/docs/trunk/src/ref/rrefsqljcreateaggregate.dita
    db/derby/docs/trunk/src/ref/rrefsqljcreatetype.dita

Modified: db/derby/docs/trunk/src/ref/refderby.ditamap
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/refderby.ditamap?rev=1531025&r1=1531024&r2=1531025&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/refderby.ditamap (original)
+++ db/derby/docs/trunk/src/ref/refderby.ditamap Thu Oct 10 15:29:27 2013
@@ -695,6 +695,7 @@ limitations under the License.
 <topicref href="rrefsqlj16357.dita" navtitle="REFERENCES clause"></topicref>
 <topicref href="rrefsqlj91438.dita" navtitle="searchCondition"></topicref>
 </topicref>
+<topicref href="rrefsqljexternalname.dita" navtitle="EXTERNAL NAME clause"></topicref>
 <topicref href="rrefsqlj31783.dita" navtitle="FOR UPDATE clause"></topicref>
 <topicref href="rrefsqlj21583.dita" navtitle="FROM clause"></topicref>
 <topicref href="rrefsqlj32654.dita" navtitle="GROUP BY clause"></topicref>

Modified: db/derby/docs/trunk/src/ref/rrefcreatefunctionstatement.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefcreatefunctionstatement.dita?rev=1531025&r1=1531024&r2=1531025&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefcreatefunctionstatement.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefcreatefunctionstatement.dita Thu Oct 10 15:29:27 2013
@@ -95,31 +95,35 @@ allowed as the type of a column in the d
 
 <example id="rrefcrprofunctionelement"> <title>functionElement</title>
 <codeblock><b>{
-    LANGUAGE { JAVA } |
-    <i><xref href="rrefcreatefunctionstatement.dita#rrefcreatefunctionstatement/rrefcrfunctiondetchar">deterministicCharacteristic</xref></i>
|
-    EXTERNAL NAME <i>string</i> |
-    PARAMETER STYLE <i><xref href="rrefcreatefunctionstatement.dita#rrefcreatefunctionstatement/rrefcrfunctionparameterstyle">parameterStyle</xref></i>
|
+    LANGUAGE JAVA |
+    { DETERMINISTIC | NOT DETERMINISTIC } |
+    EXTERNAL NAME <i>singleQuotedString</i> |
+    PARAMETER STYLE { JAVA | DERBY_JDBC_RESULT_SET | DERBY } |
     EXTERNAL SECURITY { DEFINER | INVOKER } |
     { NO SQL | CONTAINS SQL | READS SQL DATA } |
     { RETURNS NULL ON NULL INPUT | CALLED ON NULL INPUT }
 }</b></codeblock></example>
-<section><title>LANGUAGE</title><p><b>JAVA</b>- the database
manager will
-call the function as a public static method in a Java class.</p></section>
-<section><title>EXTERNAL NAME <i>string</i></title><p><i>String</i>
describes
-the Java method to be called when the function is executed, and takes the
-following form: <codeblock>class_name.method_name</codeblock>The External
-Name cannot have any extraneous spaces.</p></section>
-<section id="rrefcrfunctiondetchar"><title>deterministicCharacteristic</title>
-<codeblock><b>DETERMINISTIC | NOT DETERMINISTIC</b></codeblock>
-<p>Declares that the function is deterministic, meaning that with the same
-set of input values, it always computes the same result. The default is NOT
-DETERMINISTIC. <ph conref="../conrefs.dita#prod/productshortname"></ph> cannot
-recognize whether an operation is actually deterministic, so you must take care
-to specify the <i>deterministicCharacteristic</i> correctly.</p>
-</section>
-<example id="rrefcrfunctionparameterstyle"><title>parameterStyle</title>
-<codeblock><b>JAVA | DERBY_JDBC_RESULT_SET | DERBY</b></codeblock></example>
-<section><dl>
+<section><p>The function elements may appear in any order, but each type of
+element can only appear once. A function definition must contain these elements:
+<ul>
+<li><b>LANGUAGE</b></li>
+<li><b>EXTERNAL NAME</b></li>
+<li><b>PARAMETER STYLE</b></li>
+</ul></p></section>
+<section><title>LANGUAGE JAVA</title><p>The database manager will
call the
+function as a public static method in a Java class.</p></section>
+<section><title>DETERMINISTIC, NOT DETERMINISTIC</title>
+<p>DETERMINISTIC declares that the function is deterministic, meaning that with
+the same set of input values, it always computes the same result. The default is
+NOT DETERMINISTIC. <ph conref="../conrefs.dita#prod/productshortname"></ph>
+cannot recognize whether an operation is actually deterministic, so you must
+take care to specify this element correctly.</p></section>
+<section><title>EXTERNAL NAME <i>singleQuotedString</i></title>
+<p>The <i>singleQuotedString</i> specified by the <xref
+href="rrefsqljexternalname.dita#rrefsqljexternalname"></xref> describes
+the Java method to be called when the function is executed.</p></section>
+<section><title>PARAMETER STYLE</title>
+<dl>
 <dlentry>
 <dt>JAVA</dt>
 <dd>The function will use a parameter-passing convention that conforms to the
@@ -141,12 +145,12 @@ and which is mapped to a method which re
 </dlentry>
 <dlentry>
 <dt>DERBY</dt>
-<dd>The parameter style must be DERBY if and only if an ellipsis
+<dd>The PARAMETER STYLE must be DERBY if and only if an ellipsis
 (<codeph>...</codeph>) appears at the end of the argument list.</dd>
 </dlentry>
 </dl>
 </section>
-<section id="rrefcrfunctiondefrts"><title>EXTERNAL SECURITY</title>
+<section><title>EXTERNAL SECURITY</title>
 <p>If SQL authorization mode is enabled, a function runs by default with the
 privileges specified for the user who invokes the function (invoker's rights).
 To specify that the function should run with the privileges specified for the
@@ -198,12 +202,6 @@ null. This specification means that the 
 null argument values. The function can return a null or non-null value. This
 is the default setting.</dd>
 </dlentry></dl></p></section>
-<section><p>The function elements may appear in any order, but each type of
-element can only appear once. A function definition must contain these elements: <ul>
-<li><b>LANGUAGE</b></li>
-<li><b>PARAMETER STYLE</b></li>
-<li><b>EXTERNAL NAME</b></li>
-</ul></p></section>
 <section><title>Example of declaring a scalar function</title>
 <codeblock><b>
 CREATE FUNCTION TO_DEGREES

Modified: db/derby/docs/trunk/src/ref/rrefcreateprocedurestatement.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefcreateprocedurestatement.dita?rev=1531025&r1=1531024&r2=1531025&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefcreateprocedurestatement.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefcreateprocedurestatement.dita Thu Oct 10 15:29:27 2013
@@ -60,32 +60,37 @@ allowed as parameters in a CREATE PROCED
 <example id="rrefcrproprocedureelement"> <title>procedureElement</title>
 <codeblock><b>{ 
     [ DYNAMIC ] RESULT SETS <i><xref href="rrefsqlj10696.dita#rrefsqlj10696">integer</xref></i>
|
-    LANGUAGE { JAVA } |
-    <i><xref href="rrefcreateprocedurestatement.dita#rrefcreateprocedurestatement/rrefcrproceduredetchar">deterministicCharacteristic</xref></i>
|
-    EXTERNAL NAME <i>string</i> |
+    LANGUAGE JAVA |
+    { DETERMINISTIC | NOT DETERMINISTIC } |
+    EXTERNAL NAME <i>singleQuotedString</i> |
     PARAMETER STYLE { JAVA | DERBY } |
     EXTERNAL SECURITY { DEFINER | INVOKER } |
     { NO SQL | MODIFIES SQL DATA | CONTAINS SQL | READS SQL DATA }
- }
-</b></codeblock></example>
+}</b></codeblock></example>
+<section><p>The procedure elements may appear in any order, but each type
+of element can only appear once. A procedure definition must contain these
+elements: <ul>
+<li><b>LANGUAGE</b></li>
+<li><b>EXTERNAL NAME</b></li>
+<li><b>PARAMETER STYLE</b></li>
+</ul></p></section>
 <section><title>DYNAMIC RESULT SETS <i>integer</i></title>
<p>Indicates the
 estimated upper bound of returned result sets for the procedure. Default is
 no (zero) dynamic result sets. If the procedure takes varargs, the value must
 be zero.</p></section>
-<section><title>LANGUAGE</title> <p><b>JAVA</b>- the
database manager will
-call the procedure as a public static method in a Java class.</p></section>
-<section><title>EXTERNAL NAME <i>string</i></title> <p><i>String</i>
describes
-the Java method to be called when the procedure is executed, and takes the
-following form: <codeblock>class_name.method_name</codeblock>The External
-Name cannot have any extraneous spaces.</p></section>
-<section id="rrefcrproceduredetchar"><title>deterministicCharacteristic</title>
-<codeblock><b>DETERMINISTIC | NOT DETERMINISTIC</b></codeblock>
-<p>Declares that the procedure is deterministic, meaning that with the same
-set of input values, it always computes the same result. The default is NOT
-DETERMINISTIC. <ph conref="../conrefs.dita#prod/productshortname"></ph> cannot
-recognize whether an operation is actually deterministic, so you must take care
-to specify the <i>deterministicCharacteristic</i> correctly. </p>
+<section><title>LANGUAGE JAVA</title> <p>The database manager will
call the
+procedure as a public static method in a Java class.</p></section>
+<section><title>DETERMINISTIC, NOT DETERMINISTIC</title>
+<p>DETERMINISTIC declares that the procedure is deterministic, meaning that with
+the same set of input values, it always computes the same result. The default is
+NOT DETERMINISTIC. <ph conref="../conrefs.dita#prod/productshortname"></ph>
+cannot recognize whether an operation is actually deterministic, so you must
+take care to specify this element correctly.</p>
 </section>
+<section><title>EXTERNAL NAME <i>singleQuotedString</i></title>
+<p>The <i>singleQuotedString</i> specified by the <xref
+href="rrefsqljexternalname.dita#rrefsqljexternalname"></xref> describes
+the Java method to be called when the procedure is executed.</p></section>
 <section><title>PARAMETER STYLE</title>
 <dl>
 <dlentry>
@@ -101,7 +106,7 @@ An error will occur if you try to use on
 </dlentry>
 <dlentry>
 <dt>DERBY</dt>
-<dd>The parameter style must be DERBY if and only if an ellipsis
+<dd>The PARAMETER STYLE must be DERBY if and only if an ellipsis
 (<codeph>...</codeph>) appears at the end of the argument list.</dd>
 </dlentry>
 </dl>
@@ -152,13 +157,6 @@ with EXTERNAL SECURITY will result in an
 <dt>MODIFIES SQL DATA</dt>
 <dd>Indicates that the stored procedure can execute any SQL statement.</dd>
 </dlentry></dl></section>
-<section><p>The procedure elements may appear in any order, but each type
-of element can only appear once. A procedure definition must contain these
-elements: <ul>
-<li><b>LANGUAGE</b></li>
-<li><b>PARAMETER STYLE</b></li>
-<li><b>EXTERNAL NAME</b></li>
-</ul></p></section>
 <section><title>Examples</title> <codeblock><b>CREATE PROCEDURE
SALES.TOTAL_REVENUE(IN S_MONTH INTEGER,
 IN S_YEAR INTEGER, OUT TOTAL DECIMAL(10,2))
 PARAMETER STYLE JAVA READS SQL DATA LANGUAGE JAVA EXTERNAL NAME 

Modified: db/derby/docs/trunk/src/ref/rrefsqljcreateaggregate.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljcreateaggregate.dita?rev=1531025&r1=1531024&r2=1531025&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljcreateaggregate.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqljcreateaggregate.dita Thu Oct 10 15:29:27 2013
@@ -34,7 +34,7 @@ aggregate (UDA). A UDA is a custom aggre
 <codeblock><b>CREATE DERBY AGGREGATE <i><xref 
 href="rrefaggregatename.dita#rrefaggregatename">aggregateName</xref></i> FOR
<i>valueDataType</i>
 [ RETURNS <i>returnDataType</i> ]
-EXTERNAL NAME <i>classNameString</i></b></codeblock>
+<xref href="rrefsqljexternalname.dita#rrefsqljexternalname">EXTERNAL NAME</xref>
<i>singleQuotedString</i></b></codeblock>
 <p>The aggregate name is composed of an optional <i><xref
 href="rrefschemaname.dita#rrefschemaname">schemaName</xref></i>
 and a <i>SQL92Identifier</i>. If a <i>schemaName</i> is not provided,
the
@@ -72,8 +72,9 @@ XML, including user-defined types.</p>
 <ph conref="../conrefs.dita#prod/productshortname"></ph> data type except for
 XML. If the <i>returnDataType</i> is omitted, it defaults to be the same as
 <i>valueDataType</i>.</p>
-<p>The <i>classNameString</i> is a single-quoted string. It is the full
name of
-a Java class which implements the <i>org.apache.derby.agg.Aggregator</i>
+<p>The <i>singleQuotedString</i> specified by the <xref
+href="rrefsqljexternalname.dita#rrefsqljexternalname"></xref> is the full name
+of a Java class which implements the <i>org.apache.derby.agg.Aggregator</i>
 interface. That contract is not checked until a statement is compiled which
 invokes the UDA.</p>
 <p>The <i>org.apache.derby.agg.Aggregator</i> interface extends

Modified: db/derby/docs/trunk/src/ref/rrefsqljcreatetype.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljcreatetype.dita?rev=1531025&r1=1531024&r2=1531025&view=diff
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljcreatetype.dita (original)
+++ db/derby/docs/trunk/src/ref/rrefsqljcreatetype.dita Thu Oct 10 15:29:27 2013
@@ -30,22 +30,25 @@ limitations under the License.
 <refbody>
 <section><p>
 The CREATE TYPE statement creates a user-defined type (UDT). A UDT is a
-serializable Java class whose instances are stored in columns. The class must
+serializable Java class whose instances are stored in columns. The class,
+specified by the <xref
+href="rrefsqljexternalname.dita#rrefsqljexternalname"></xref>, must
 implement the <i>java.io.Serializable</i> interface.</p></section>
 <refsyn><title>Syntax</title>
 <codeblock><b>CREATE TYPE <i><xref 
 href="rreftypename.dita#rreftypename">typeName</xref></i>
-EXTERNAL NAME <i>singleQuotedJavaClassName</i>
+<xref href="rrefsqljexternalname.dita#rrefsqljexternalname">EXTERNAL NAME</xref>
<i>singleQuotedString</i>
 LANGUAGE JAVA</b></codeblock>
 <p>The type name is composed of an optional <i><xref
 href="rrefschemaname.dita#rrefschemaname">schemaName</xref></i> and a
 <i>SQL92Identifier</i>. If a <i>schemaName</i> is not provided,
 the current schema is the default schema. If a qualified type name is specified,
 the schema name cannot begin with SYS.</p>
-<p>If the Java class does not implement <i>java.io.Serializable</i>, or
if it is
-not public and visible on the classpath,
-<ph conref="../conrefs.dita#prod/productshortname"></ph> raises an exception
-when preparing statements which refer to the UDT.</p>
+<p>If the Java class specified by the <xref
+href="rrefsqljexternalname.dita#rrefsqljexternalname"></xref> does not implement
+<i>java.io.Serializable</i>, or if it is not public and visible on the
+classpath, <ph conref="../conrefs.dita#prod/productshortname"></ph> raises an
+exception when preparing statements which refer to the UDT.</p>
 <p>A UDT cannot be cast explicitly to any other type, and no other type can be
 cast to a UDT.</p>
 <p>A UDT has no ordering. This means that you cannot compare and sort UDTs. You

Added: db/derby/docs/trunk/src/ref/rrefsqljexternalname.dita
URL: http://svn.apache.org/viewvc/db/derby/docs/trunk/src/ref/rrefsqljexternalname.dita?rev=1531025&view=auto
==============================================================================
--- db/derby/docs/trunk/src/ref/rrefsqljexternalname.dita (added)
+++ db/derby/docs/trunk/src/ref/rrefsqljexternalname.dita Thu Oct 10 15:29:27 2013
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- 
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at      
+
+http://www.apache.org/licenses/LICENSE-2.0  
+
+Unless required by applicable law or agreed to in writing, software  
+distributed under the License is distributed on an "AS IS" BASIS,  
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
+See the License for the specific language governing permissions and  
+limitations under the License.
+-->
+
+<!DOCTYPE reference PUBLIC "-//OASIS//DTD DITA Reference//EN"
+ "../dtd/reference.dtd">
+<reference id="rrefsqljexternalname" xml:lang="en-us">
+<title>EXTERNAL NAME clause</title>
+<prolog><metadata>
+<keywords><indexterm>EXTERNAL NAME clause</indexterm>
+</keywords>
+</metadata></prolog>
+<refbody>
+<section>
+<p>The EXTERNAL NAME clause specifies the Java method to be called in a <xref
+href="rrefcreatefunctionstatement.dita#rrefcreatefunctionstatement">CREATE
+FUNCTION statement</xref> or a <xref
+href="rrefcreateprocedurestatement.dita#rrefcreateprocedurestatement">CREATE
+PROCEDURE statement</xref>, and it specifies a Java class in a <xref
+href="rrefsqljcreateaggregate.dita#rrefsqljcreateaggregate">CREATE AGGREGATE
+statement</xref> or a <xref
+href="rrefsqljcreatetype.dita#rrefsqljcreatetype">CREATE TYPE statement</xref>.
+</p>
+</section>
+<refsyn><title>Syntax</title>
+<codeblock><b>EXTERNAL NAME <i>singleQuotedString</i></b></codeblock>
+<p>The <i>singleQuotedString</i> cannot have any extraneous spaces.</p>
+<p>The method name specified in the CREATE FUNCTION or CREATE PROCEDURE
+statement normally takes the following form:</p>
+<codeblock><b>'<i>class_name</i>.<i>method_name</i>'</b></codeblock>
+<p>If the class is a static nested class, or if the method is in a static nested
+class, use a dollar sign ($) as a separator between the outer and static class.
+For example, suppose you have the following class and method definition:</p>
+<codeblock><b>public class TestFuncs {
+    public static final class MyMath {
+        public static double pow( double base, double power ) {
+            return Math.pow( base, power );
+        }
+    }
+}</b></codeblock>
+<p>If you use CREATE FUNCTION to bind this <i>pow</i> method to a user-defined
+function, the external name should be <i>TestFuncs$MyMath.pow</i>, not
+<i>TestFuncs.MyMath.pow</i>.</p>
+</refsyn>
+<example><title>Examples</title>
+<codeblock><b>-- Specify the Mode class as an external name
+CREATE DERBY AGGREGATE mode FOR INT
+EXTERNAL NAME 'com.example.myapp.aggs.Mode';</b></codeblock>
+<codeblock><b>-- Specify the pow method in the static class MyMath
+CREATE FUNCTION MYPOWER ( X DOUBLE, Y DOUBLE )
+RETURNS DOUBLE
+PARAMETER STYLE JAVA
+NO SQL LANGUAGE JAVA
+EXTERNAL NAME 'TestFuncs$MyMath.pow'</b></codeblock>
+</example>
+</refbody>
+</reference>

Propchange: db/derby/docs/trunk/src/ref/rrefsqljexternalname.dita
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message