private void set(PreparedStatement stmt, Path<?> path, int i, Object value) throws SQLException{ configuration.set(stmt, path, i, value); }
/** * Set the parameters to the given PreparedStatement * * @param stmt preparedStatement to be populated * @param objects list of constants * @param constantPaths list of paths related to the constants * @param params map of param to value for param resolving */ protected void setParameters(PreparedStatement stmt, List<?> objects, List<Path<?>> constantPaths, Map<ParamExpression<?>, ?> params) { if (objects.size() != constantPaths.size()) { throw new IllegalArgumentException("Expected " + objects.size() + " paths, " + "but got " + constantPaths.size()); } for (int i = 0; i < objects.size(); i++) { Object o = objects.get(i); try { if (o instanceof ParamExpression) { if (!params.containsKey(o)) { throw new ParamNotSetException((ParamExpression<?>) o); } o = params.get(o); } configuration.set(stmt, constantPaths.get(i), i+1, o); } catch (SQLException e) { throw configuration.translate(e); } } }