/** * Returns a new instance with the specified key-value pair added. * <p> * This copies the internal map and calls {@link Map#put(Object, Object)}. * * @param key the key to add * @param value the value to add * @return the new instance with pair added */ public MapSqlParams with(String key, Object value) { Map<String, Object> map = new HashMap<String, Object>(_map); map.put(key, value); return new MapSqlParams(map); }
/** * Finds SQL for a named fragment key, providing a map of SQL parameters. * <p> * This finds, processes and returns a named block from the bundle. * The parameters are used to provide intelligent processing of SQL based on * the actual data in the request. * * @param name the name, not null * @param params the SQL parameters, not null * @return the SQL, not null * @throws IllegalArgumentException if there is no fragment with the specified name * @throws RuntimeException if a problem occurs */ public String getSql(String name, Map<String, Object> params) { return _fragments.getSql(name, new MapSqlParams(params)); }