class MonitoringNotificationDao extends NamedParameterJdbcDaoSupport {

    @Transactional(propagation = Propagation.MANDATORY)
    public void createMonitoringNotifications(List<NotificationMessage> notificationMessages) {
        List<Long> ids = daoHelper.createIds(notificationQueueSequence, notificationMessages.size());

        MapSqlParameterSource[] params = IntStream.range(0, notificationMessages.size())
            .mapToObj(i -> {
                NotificationMessage message = notificationMessages.get(i);
                message.setId(ids.get(i));
                return MonitoringNotificationParameters.getParameters(message);
            })
            .toArray(MapSqlParameterSource[]::new);

        getNamedParameterJdbcTemplate().batchUpdate(createMonitoringNotificationQuery, params);
    }

}