- Add the Codota plugin to your IDE and get smart completions
private void myMethod () {}
@Transactional(propagation = Propagation.REQUIRES_NEW) /** * Delete hidden annotations for each cv given in the collection */ public void removeHiddenFrom(Collection<CvObject> cvs){ DaoFactory factory = IntactContext.getCurrentInstance().getDaoFactory(); AnnotationDao annDao = factory.getAnnotationDao(); for (CvObject cv : cvs){ cv = factory.getEntityManager().merge(cv); Collection<Annotation> annotations = new ArrayList<Annotation>(cv.getAnnotations()); for (Annotation annotation : annotations){ if (annotation.getCvTopic() != null && CvTopic.HIDDEN.equalsIgnoreCase(annotation.getCvTopic().getShortLabel())){ cv.removeAnnotation(annotation); annDao.delete(annotation); } } } }
IntactContext.getCurrentInstance().getDataContext().getDaoFactory().getAnnotationDao().delete( annotation );
annotationDao.delete(deleted);