@Transactional
 public void errorMediaFile(Long id) {
   MediaFile mediaFile = mediaDao.getById(MediaFile.class, id);
   if (mediaFile != null) {
     mediaFile.setStatus(StatusType.ERROR);
     mediaDao.updateEntity(mediaFile);
   }
 }
 @Transactional(readOnly = true)
 public List<QueueDTO> getMediaFileQueueForScanning(final int maxResults) {
   final StringBuilder sql = new StringBuilder();
   sql.append("select mf.id, mf.create_timestamp, mf.update_timestamp ");
   sql.append("from mediafile mf ");
   sql.append("where mf.status in ('NEW','UPDATED') ");
   return mediaDao.getMediaQueue(sql, maxResults);
 }
 @Transactional
 public void updateMediaFile(MediaFile mediaFile) {
   mediaDao.storeAll(mediaFile.getAudioCodecs());
   mediaDao.updateEntity(mediaFile);
 }