Class Parameters
java.lang.Object
org.postgresql.pljava.example.annotation.Parameters
@SQLAction(install="CREATE OR REPLACE FUNCTION javatest.java_getTimestamptz()\tRETURNS timestamptz\tAS \'org.postgresql.pljava.example.annotation.Parameters.getTimestamp\'\tLANGUAGE java",
remove="DROP FUNCTION javatest.java_getTimestamptz()")
public class Parameters
extends Object
Some methods used for testing parameter and return value coersion and
resolution of overloaded methods.
About the @SQLAction
here: the original, hand-crafted deployment
descriptor declared two SQL functions both implemented by the same
getTimestamp
method here. Only one declaration can be
automatically generated from a @Function
annotation on the method
itself. This @SQLAction
takes care of the other declaration.
Of course, there is now a burden on the author to get this declaration right
and to keep it up to date if the method evolves, but at least it is here in
the same file, rather than in a separate hand-maintained DDR file.
- Author:
- Thomas Hallgren
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic double
addNumbers
(short a, int b, long c, BigDecimal d, BigDecimal e, float f, double g) static int
addOne
(int value) static int
static int
addOneLong
(long value) static int
countNulls
(Integer[] intArray) static int
countNulls
(ResultSet input) static Date
getDate()
static Time
getTime()
static Timestamp
static Integer
nullOnEven
(int value) static byte
print
(byte value) static byte[]
print
(byte[] byteArray) static double
print
(double value) static double[]
print
(double[] doubleArray) static float
print
(float value) static float[]
print
(float[] floatArray) static int
print
(int value) static int[]
print
(int[] intArray) static long
print
(long value) static long[]
print
(long[] longArray) static short
print
(short value) static short[]
print
(short[] shortArray) static Integer[]
static void
static void
static void
-
Constructor Details
-
Parameters
public Parameters()
-
-
Method Details
-
addNumbers
public static double addNumbers(short a, int b, long c, BigDecimal d, BigDecimal e, float f, double g) -
addOne
-
addOne
-
addOneLong
-
countNulls
- Throws:
SQLException
-
countNulls
- Throws:
SQLException
-
getDate
-
getTime
-
getTimestamp
-
nullOnEven
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-
print
-