List of usage examples for org.hibernate StatelessSession delete
void delete(String entityName, Object entity);
From source file:edu.uncc.genosets.studyset.StudySetDeleter.java
License:Open Source License
@Override public void persist(StatelessSession ss) { if (toDelete != null) { for (FactStudySet factStudySet : toDelete) { if (factStudySet.getFactId() != null) { ss.delete(factStudySet.getEntityName(), factStudySet); }// www . ja v a2 s . c o m } } if (studySet.getId() != null) { ss.delete(studySet.getEntityName(), studySet); } }
From source file:edu.uncc.genosets.studyset.StudySetPersister.java
License:Open Source License
@Override public void persist(StatelessSession ss) { if (studySet.getId() == null) { ss.insert(studySet.getEntityName(), studySet); } else {//from w w w. j a v a 2 s. c o m ss.update(studySet.getEntityName(), studySet); } if (toAdd != null) { for (FactStudySet factStudySet : toAdd) { if (factStudySet.getFactId() == null) { factStudySet.setStudySetId(studySet.getId()); ss.insert(factStudySet.getEntityName(), factStudySet); } } } if (toDelete != null) { for (FactStudySet factStudySet : toDelete) { if (factStudySet.getFactId() != null) { ss.delete(factStudySet.getEntityName(), factStudySet); } } } }