import org.splat.dal.dao.som.DocumentDAO;
import org.splat.dal.dao.som.DocumentTypeDAO;
import org.splat.dal.dao.som.FileDAO;
+import org.splat.dal.dao.som.StudyDAO;
import org.splat.kernel.InvalidPropertyException;
import org.splat.kernel.MissedPropertyException;
import org.splat.kernel.NotApplicableException;
* Injected file DAO.
*/
private FileDAO _fileDAO;
+ /**
+ * Injected study DAO.
+ */
+ private StudyDAO _studyDAO;
/**
* {@inheritDoc}
else
owner = ((Scenario) dprop.getOwner()).getOwnerStudy();
+ // Synchronize the object with the current Hibernate session.
+ owner = getStudyDAO().get(owner.getIndex());
+
SimpleDateFormat tostring = new SimpleDateFormat("yyyy");
String year = tostring.format(owner.getDate());
String filename = generateEncodedName(aDoc, owner);
public void release(Document aDoc) {
aDoc.setCountag(aDoc.getCountag() - 1);
if (aDoc.isSaved()) {
- getDocumentDAO().update(aDoc);
+ getDocumentDAO().merge(aDoc);
}
}
// Update this document and the previous version, if exit
if (previous != null) {
previous.setHistory(previous.getHistory() + 1);
- getDocumentDAO().update(previous);
+ getDocumentDAO().merge(previous);
}
aDoc.setProgressState(state);
getDocumentDAO().update(aDoc);
_fileDAO = fileDAO;
}
+ /**
+ * Get the studyDAO.
+ * @return the studyDAO
+ */
+ public StudyDAO getStudyDAO() {
+ return _studyDAO;
+ }
+
+ /**
+ * Set the studyDAO.
+ * @param studyDAO the studyDAO to set
+ */
+ public void setStudyDAO(StudyDAO studyDAO) {
+ _studyDAO = studyDAO;
+ }
+
}