All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bitbucket.brunneng.qb.QueryWithParams Maven / Gradle / Ivy

Go to download

Compact tool for building SQL, JPA or hibernate queries. Supports utilities for spring pagination and sorting. Supports extending to other types of query languages. Has no transitive dependencies - use only what you need.

The newest version!
package org.bitbucket.brunneng.qb;

import java.util.Collections;
import java.util.Map;
import java.util.StringJoiner;

/**
 * Immutable POJO which holds query string and it's named parameters map.
 */
public class QueryWithParams {
   private final String query;
   private final Map parameters;

   public QueryWithParams(String query, Map parameters) {
      this.query = query;
      this.parameters = Collections.unmodifiableMap(parameters);
   }

   public String getQuery() {
      return query;
   }

   public Map getParameters() {
      return parameters;
   }

   @Override
   public String toString() {
      return new StringJoiner(", ", "[", "]")
            .add("query='" + query + "'")
            .add("parameters=" + parameters)
            .toString();
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy