Class 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
    • Method Detail

      • 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)
      • 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 void print​(Date value)
      • 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)
      • print

        @Function(schema="javatest")
        public static void print​(@SQLType("timetz")
                                 Time value)
      • print

        @Function(schema="javatest")
        public static void print​(@SQLType("timestamptz")
                                 Timestamp value)