/** * Method that provides execution of the insert using the passed-in * {@link SqlParameterSource} and returning all generated keys. * @param parameterSource parameter names and values to be used in insert * @return the KeyHolder containing keys generated by the insert */ protected KeyHolder doExecuteAndReturnKeyHolder(SqlParameterSource parameterSource) { checkCompiled(); List<Object> values = matchInParameterValuesWithInsertColumns(parameterSource); return executeInsertAndReturnKeyHolderInternal(values); }
/** * Method that provides execution of the insert using the passed-in * Map of parameters and returning all generated keys. * @param args a Map with parameter names and values to be used in insert * @return the KeyHolder containing keys generated by the insert */ protected KeyHolder doExecuteAndReturnKeyHolder(Map<String, ?> args) { checkCompiled(); List<Object> values = matchInParameterValuesWithInsertColumns(args); return executeInsertAndReturnKeyHolderInternal(values); }
/** * Delegate method to execute the insert, generating a single key. */ private Number executeInsertAndReturnKeyInternal(final List<?> values) { KeyHolder kh = executeInsertAndReturnKeyHolderInternal(values); if (kh.getKey() != null) { return kh.getKey(); } else { throw new DataIntegrityViolationException( "Unable to retrieve the generated key for the insert: " + getInsertString()); } }
/** * Method that provides execution of the insert using the passed in Map of parameters * and returning all generated keys * * @param args Map with parameter names and values to be used in insert * @return the KeyHolder containing keys generated by the insert */ protected KeyHolder doExecuteAndReturnKeyHolder(Map<String, Object> args) { checkCompiled(); List<Object> values = matchInParameterValuesWithInsertColumns(args); return executeInsertAndReturnKeyHolderInternal(values); }
/** * Method that provides execution of the insert using the passed in {@link SqlParameterSource} * and returning all generated keys * * @param parameterSource parameter names and values to be used in insert * @return the KeyHolder containing keys generated by the insert */ protected KeyHolder doExecuteAndReturnKeyHolder(SqlParameterSource parameterSource) { checkCompiled(); List<Object> values = matchInParameterValuesWithInsertColumns(parameterSource); return executeInsertAndReturnKeyHolderInternal(values); }
/** * Method that provides execution of the insert using the passed-in * {@link SqlParameterSource} and returning all generated keys. * @param parameterSource parameter names and values to be used in insert * @return the KeyHolder containing keys generated by the insert */ protected KeyHolder doExecuteAndReturnKeyHolder(SqlParameterSource parameterSource) { checkCompiled(); List<Object> values = matchInParameterValuesWithInsertColumns(parameterSource); return executeInsertAndReturnKeyHolderInternal(values); }
/** * Method to execute the insert generating single key */ private Number executeInsertAndReturnKeyInternal(final List<Object> values) { KeyHolder kh = executeInsertAndReturnKeyHolderInternal(values); if (kh != null && kh.getKey() != null) { return kh.getKey(); } else { throw new DataIntegrityViolationException( "Unable to retrieve the generated key for the insert: " + getInsertString()); } }
/** * Delegate method to execute the insert, generating a single key. */ private Number executeInsertAndReturnKeyInternal(final List<?> values) { KeyHolder kh = executeInsertAndReturnKeyHolderInternal(values); if (kh.getKey() != null) { return kh.getKey(); } else { throw new DataIntegrityViolationException( "Unable to retrieve the generated key for the insert: " + getInsertString()); } }