Class QueryAndParams


  • public final class QueryAndParams
    extends Object
    Query and Params.

    Means a prepared (and transformed if neccessary) query and parameters in sequental order.

    This class is a value-object.

    Before 8.1.3 it was an inner class of DBFunctions.

    Since:
    8.1.3
    • Field Detail

      • ourShortDescriptionLengthLimit

        public static int ourShortDescriptionLengthLimit
      • ourShortDescriptionParamLengthLimit

        public static int ourShortDescriptionParamLengthLimit
      • kind

        public final QueryKind kind
        Kind of the query.
      • query

        @NotNull
        public final String query
        The query text.
    • Constructor Detail

      • QueryAndParams

        public QueryAndParams​(@NotNull
                              QueryKind kind,
                              @NotNull
                              String query,
                              @Nullable
                              Object[] params)
        Trivial constructor. Just makes an instance.
        Parameters:
        kind - kind of the query.
        query - the query text.
        params - parameters.
      • QueryAndParams

        public QueryAndParams​(@NotNull
                              QueryKind kind,
                              @NotNull
                              String query,
                              int batchDataRows)
        Trivial constructor for batch operations. Just makes an instance.
        Parameters:
        kind - kind of the query.
        query - the query text.
        batchDataRows - number of batch data rows.
    • Method Detail

      • appendParams

        public static void appendParams​(@NotNull
                                        StringBuilder b,
                                        @Nullable
                                        Object[] params,
                                        boolean useNLs,
                                        int limitDescriptionLength,
                                        int limitParamLength)
      • getTypeDescription

        public String getTypeDescription()
        Generates and returns a description of the type of the query.
      • getParams

        @Nullable
        public Object[] getParams()
      • toString

        public String toString()
        Just calls getShortDescription()
        Overrides:
        toString in class Object
        Returns:
        the short description.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object