Merge in RED/persistence-service from RED-6310 to master
* commit '45bd8e600328ce85c8457525b605da2c16dd70c8':
RED-6310: Moved code to create user-preferences to a separate class so that the calling code can handle a persistence exception
RED-6310: Corrected services so that they use the user id instead of wrongly using the entity id
RED-6310: Moved code for multithreaded tests to a helper class
RED-6310: Removed not needed code from test
RED-6310: Added setup of tenant id to fix the service test
RED-6310: Added tests to check if concurrent access to notification-preferences works
RED-6310: Refomatted sql query for readability