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 samegetTimestamp
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 Constructor Description Parameters()
-
Method Summary
Modifier and Type Method Description static double
addNumbers(short a, int b, long c, BigDecimal d, BigDecimal e, float f, double g)
static int
addOne(int value)
static int
addOne(Integer value)
static int
addOneLong(long value)
static int
countNulls(Integer[] intArray)
static int
countNulls(ResultSet input)
static Date
getDate()
static Time
getTime()
static Timestamp
getTimestamp()
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[]
print(Integer[] intArray)
static void
print(Date value)
static void
print(Time value)
static void
print(Timestamp value)
-
-
-
Constructor Detail
-
Parameters
public Parameters()
-
-
Method Detail
-
addNumbers
public static double addNumbers(short a, int b, long c, BigDecimal d, BigDecimal e, float f, double g)
-
addOne
public static int addOne(int value)
-
addOne
@Function(schema="javatest", name="java_addOne", effects=IMMUTABLE) public static int addOne(Integer value)
-
addOneLong
public static int addOneLong(long value)
-
countNulls
@Function(schema="javatest") public static int countNulls(Integer[] intArray) throws SQLException
- Throws:
SQLException
-
countNulls
@Function(schema="javatest") public static int countNulls(ResultSet input) throws SQLException
- Throws:
SQLException
-
getTimestamp
@Function(schema="javatest", name="java_getTimestamp") public static Timestamp getTimestamp()
-
nullOnEven
@Function(schema="javatest", effects=IMMUTABLE) public static Integer nullOnEven(int value)
-
print
@Function(schema="javatest", type="\"char\"") public static byte print(@SQLType("\"char\"") byte value)
-
print
@Function(schema="javatest") public static byte[] print(byte[] byteArray)
-
print
@Function(schema="javatest") public static double print(double value)
-
print
@Function(schema="javatest") public static double[] print(double[] doubleArray)
-
print
@Function(schema="javatest") public static float print(float value)
-
print
@Function(schema="javatest") public static float[] print(float[] floatArray)
-
print
@Function(schema="javatest") public static int print(int value)
-
print
@Function(schema="javatest") public static int[] print(int[] intArray)
-
print
@Function(schema="javatest", name="printObj") public static Integer[] print(Integer[] intArray)
-
print
@Function(schema="javatest") public static long print(long value)
-
print
@Function(schema="javatest") public static long[] print(long[] longArray)
-
print
@Function(schema="javatest") public static short print(short value)
-
print
@Function(schema="javatest") public static short[] print(short[] shortArray)
-
-