Package ai.heavy.jdbc

Class HeavyAIEscapeFunctions


  • public final class HeavyAIEscapeFunctions
    extends Object
    • Constructor Detail

      • HeavyAIEscapeFunctions

        public HeavyAIEscapeFunctions()
    • Method Detail

      • getFunction

        public static Method getFunction​(String functionName)
        get Method object implementing the given function
        Parameters:
        functionName - name of the searched function
        Returns:
        a Method object or null if not found
      • sqlceiling

        public static void sqlceiling​(StringBuilder buf,
                                      List<? extends CharSequence> parsedArgs)
                               throws SQLException
        ceiling to ceil translation
        Parameters:
        buf - The buffer to append into
        parsedArgs - arguments
        Throws:
        SQLException - if something wrong happens
      • sqldayofmonth

        public static void sqldayofmonth​(StringBuilder buf,
                                         List<? extends CharSequence> parsedArgs)
                                  throws SQLException
        dayofmonth translation
        Parameters:
        buf - The buffer to append into
        parsedArgs - arguments
        Throws:
        SQLException - if something wrong happens
      • sqldayofweek

        public static void sqldayofweek​(StringBuilder buf,
                                        List<? extends CharSequence> parsedArgs)
                                 throws SQLException
        dayofweek translation adding 1 to postgresql function since we expect values from 1 to 7
        Parameters:
        buf - The buffer to append into
        parsedArgs - arguments
        Throws:
        SQLException - if something wrong happens
      • sqldayofyear

        public static void sqldayofyear​(StringBuilder buf,
                                        List<? extends CharSequence> parsedArgs)
                                 throws SQLException
        dayofyear translation
        Parameters:
        buf - The buffer to append into
        parsedArgs - arguments
        Throws:
        SQLException - if something wrong happens
      • sqlquarter

        public static void sqlquarter​(StringBuilder buf,
                                      List<? extends CharSequence> parsedArgs)
                               throws SQLException
        quarter translation
        Parameters:
        buf - The buffer to append into
        parsedArgs - arguments
        Throws:
        SQLException - if something wrong happens
      • appendCall

        public static void appendCall​(StringBuilder sb,
                                      String begin,
                                      String separator,
                                      String end,
                                      List<? extends CharSequence> args)
        Appends begin arg0 separator arg1 separator end sequence to the input StringBuilder
        Parameters:
        sb - destination StringBuilder
        begin - begin string
        separator - separator string
        end - end string
        args - arguments