Search in sources :

Example 1 with UPDATE_SECRET_TYPE

use of org.wso2.carbon.identity.secret.mgt.core.constant.SQLConstants.UPDATE_SECRET_TYPE in project carbon-identity-framework by wso2.

the class SecretDAOImpl method replaceSecretType.

@Override
public void replaceSecretType(SecretType secretType) throws SecretManagementException {
    NamedJdbcTemplate jdbcTemplate = getNewTemplate();
    try {
        jdbcTemplate.executeInsert(UPDATE_SECRET_TYPE, preparedStatement -> {
            preparedStatement.setString(DB_SCHEMA_COLUMN_NAME_NAME, secretType.getName());
            preparedStatement.setString(DB_SCHEMA_COLUMN_NAME_DESCRIPTION, secretType.getDescription());
            preparedStatement.setString(DB_SCHEMA_COLUMN_NAME_ID, secretType.getId());
        }, secretType, false);
    } catch (DataAccessException e) {
        throw handleServerException(ERROR_CODE_UPDATE_SECRET_TYPE, secretType.getName(), e);
    }
}
Also used : NamedJdbcTemplate(org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate) DataAccessException(org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException)

Aggregations

NamedJdbcTemplate (org.wso2.carbon.database.utils.jdbc.NamedJdbcTemplate)1 DataAccessException (org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException)1