/** * Overridden version of {@code update} that adds the given statement * parameters to the queue rather than executing them immediately. * All other {@code update} methods of the SqlUpdate base class go * through this method and will thus behave similarly. * <p>You need to call {@code flush} to actually execute the batch. * If the specified batch size is reached, an implicit flush will happen; * you still need to finally call {@code flush} to flush all statements. * @param params array of parameter objects * @return the number of rows affected by the update (always -1, * meaning "not applicable", as the statement is not actually * executed by this method) * @see #flush */ @Override public int update(Object... params) throws DataAccessException { validateParameters(params); this.parameterQueue.add(params.clone()); if (this.parameterQueue.size() == this.batchSize) { if (logger.isDebugEnabled()) { logger.debug("Triggering auto-flush because queue reached batch size of " + this.batchSize); } flush(); } return -1; }
/** * Overridden version of {@code update} that adds the given statement * parameters to the queue rather than executing them immediately. * All other {@code update} methods of the SqlUpdate base class go * through this method and will thus behave similarly. * <p>You need to call {@code flush} to actually execute the batch. * If the specified batch size is reached, an implicit flush will happen; * you still need to finally call {@code flush} to flush all statements. * @param params array of parameter objects * @return the number of rows affected by the update (always -1, * meaning "not applicable", as the statement is not actually * executed by this method) * @see #flush */ @Override public int update(Object... params) throws DataAccessException { validateParameters(params); this.parameterQueue.add(params.clone()); if (this.parameterQueue.size() == this.batchSize) { if (logger.isDebugEnabled()) { logger.debug("Triggering auto-flush because queue reached batch size of " + this.batchSize); } flush(); } return -1; }
/** * Overridden version of {@code update} that adds the given statement * parameters to the queue rather than executing them immediately. * All other {@code update} methods of the SqlUpdate base class go * through this method and will thus behave similarly. * <p>You need to call {@code flush} to actually execute the batch. * If the specified batch size is reached, an implicit flush will happen; * you still need to finally call {@code flush} to flush all statements. * @param params array of parameter objects * @return the number of rows affected by the update (always -1, * meaning "not applicable", as the statement is not actually * executed by this method) * @see #flush */ @Override public int update(Object... params) throws DataAccessException { validateParameters(params); this.parameterQueue.add(params.clone()); if (this.parameterQueue.size() == this.batchSize) { if (logger.isDebugEnabled()) { logger.debug("Triggering auto-flush because queue reached batch size of " + this.batchSize); } flush(); } return -1; }