use of org.wso2.carbon.identity.configuration.mgt.core.constant.SQLConstants.DELETE_ATTRIBUTE_SQL in project carbon-identity-framework by wso2.
the class ConfigurationDAOImpl method deleteAttribute.
/**
* {@inheritDoc}
*/
@Override
public void deleteAttribute(String attributeId, String resourceId, String attributeKey) throws ConfigurationManagementException {
JdbcTemplate jdbcTemplate = JdbcUtils.getNewTemplate();
try {
jdbcTemplate.withTransaction(template -> {
template.executeUpdate(DELETE_ATTRIBUTE_SQL, (preparedStatement -> preparedStatement.setString(1, attributeId)));
template.executeUpdate(SQLConstants.UPDATE_LAST_MODIFIED_SQL, preparedStatement -> {
int initialParameterIndex = 1;
preparedStatement.setTimestamp(initialParameterIndex, new java.sql.Timestamp(new Date().getTime()), calendar);
preparedStatement.setString(++initialParameterIndex, resourceId);
});
return null;
});
} catch (TransactionException e) {
throw handleServerException(ERROR_CODE_DELETE_ATTRIBUTE, attributeKey, e);
}
}
Aggregations