ratingByIpRepository.save(ratingEntity);
//
// calculate new rating
//
final int newRating = ratingByIpRepository.averageRating(metadataId);
if(Log.isDebugEnabled(Geonet.DATA_MANAGER))
Log.debug(Geonet.DATA_MANAGER, "Setting rating for id:"+ metadataId +" --> rating is:"+newRating);