private ProjectElementService _projectElementService;
+ public Study selectStudy(int index) {
+ // -------------------------------------------
+ StringBuffer query = new StringBuffer("from Study where rid='").append(
+ index).append("'");
+ Study result = (Study) Database.getSession().createQuery(
+ query.toString()).uniqueResult();
+
+ result.loadWorkflow();
+ return result;
+ }
+
+ public Study selectStudy(String refid) {
+ // ----------------------------------------------
+ StringBuffer query = new StringBuffer("from Study where sid='").append(
+ refid).append("'");
+ Study result = (Study) Database.getSession().createQuery(
+ query.toString()).uniqueResult();
+
+ result.loadWorkflow();
+ return result;
+ }
+
public Study createStudy(Study.Properties sprop)
throws MissedPropertyException, InvalidPropertyException,
MultiplyDefinedException, RuntimeException {
return added;
}
- /**
- * @return
- */
- public StepService getStepService() {
- return _stepService;
- }
-
- public void setStepService(StepService stepService) {
- _stepService = stepService;
- }
-
public SimulationContext addProjectContext(Study aStudy,
SimulationContext context) {
// ----------------------------------------------------------------------
public int generateLocalIndex(Study aStudy) {
aStudy.setLastLocalIndex(aStudy.getLastLocalIndex() + 1);
- Database.getSession().update(this);
+ Database.getSession().update(aStudy);
return aStudy.getLastLocalIndex();
}
aStudy.getScenariiList().add(
aStudy.getScenariiList().indexOf(previous) + 1, scenario);
}
- session.update(this); // No need to update the Lucene index
+ session.update(aStudy); // No need to update the Lucene index
session.save(scenario); // Must be done after updating this study because of the back reference to the study
if (sprop.getBaseStep() != null) {
// No need to update the Knowledge Element index as Knowledge Elements are not copied
ProjectElementService projectElementService) {
_projectElementService = projectElementService;
}
+
+ /**
+ * Get the stepService.
+ * @return the stepService
+ */
+ public StepService getStepService() {
+ return _stepService;
+ }
+
+ /**
+ * Set the stepService.
+ * @param stepService the stepService to set
+ */
+ public void setStepService(StepService stepService) {
+ _stepService = stepService;
+ }
}