Class PostgresParameters


  • public class PostgresParameters
    extends Parameters
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String process​(java.lang.String sql)  
      java.lang.String process​(java.lang.String sql, int parameterCount)
      Replace all JDBC-style ? parameters with Postgres-style $n parameters in the given SQL string.
      java.lang.String processLimit​(java.lang.String sql, java.lang.Object[] parameterArray, boolean hasOffset)
      Limit and offset gets applied just before the execution of the query but because we know how the string looks like for Postgres, it's faster to replace the last bit instead of processing the whole query
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • process

        public java.lang.String process​(java.lang.String sql)
        Specified by:
        process in class Parameters
      • processLimit

        public java.lang.String processLimit​(java.lang.String sql,
                                             java.lang.Object[] parameterArray,
                                             boolean hasOffset)
        Limit and offset gets applied just before the execution of the query but because we know how the string looks like for Postgres, it's faster to replace the last bit instead of processing the whole query
        Specified by:
        processLimit in class Parameters
      • process

        public java.lang.String process​(java.lang.String sql,
                                        int parameterCount)
        Replace all JDBC-style ? parameters with Postgres-style $n parameters in the given SQL string.
        Specified by:
        process in class Parameters