]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman-Common/src/org/splat/service/StepServiceImpl.java
Salome HOME
Mapping is fixed. Relation in the mapping is inherited from Persistent now. Versionin...
[tools/siman.git] / Workspace / Siman-Common / src / org / splat / service / StepServiceImpl.java
index d40b87a50d22c329a76ec721b96721a337ea5b29..5472c81e2ee51f692dbcf26e2078429172f6ef5b 100644 (file)
@@ -32,6 +32,7 @@ import org.splat.dal.dao.som.DocumentDAO;
 import org.splat.dal.dao.som.FileDAO;
 import org.splat.dal.dao.som.ProjectElementDAO;
 import org.splat.dal.dao.som.SimulationContextDAO;
+import org.splat.dal.dao.som.VersionsRelationDAO;
 import org.splat.kernel.InvalidPropertyException;
 import org.splat.kernel.MismatchException;
 import org.splat.kernel.MissedPropertyException;
@@ -87,6 +88,10 @@ public class StepServiceImpl implements StepService {
         * Injected project element DAO.
         */
        private ProjectElementDAO _projectElementDAO;
+       /**
+        * Injected versions relation DAO.
+        */
+       private VersionsRelationDAO _versionsRelationDAO;
 
        /**
         * {@inheritDoc}
@@ -358,11 +363,11 @@ public class StepServiceImpl implements StepService {
                getDocumentDAO().create(newdoc);
 
                // Versioning
-               if (summary == null)
-                       newdoc.addRelation(new VersionsRelation(newdoc, previous));
-               else
-                       newdoc.addRelation(new VersionsRelation(newdoc, previous, summary));
-
+               VersionsRelation aRel;
+               aRel = new VersionsRelation(newdoc, previous, summary);
+//             getVersionsRelationDAO().create(aRel);
+               newdoc.addRelation(aRel);
+               
                // Update of usedby relations, if exist
                List<Relation> relist = previous.getRelations(UsedByRelation.class);
                Study scope = aStep.getOwnerStudy();
@@ -615,4 +620,20 @@ public class StepServiceImpl implements StepService {
        public void setDocumentTypeService(DocumentTypeService documentTypeService) {
                _documentTypeService = documentTypeService;
        }
+
+       /**
+        * Get the versionsRelationDAO.
+        * @return the versionsRelationDAO
+        */
+       public VersionsRelationDAO getVersionsRelationDAO() {
+               return _versionsRelationDAO;
+       }
+
+       /**
+        * Set the versionsRelationDAO.
+        * @param versionsRelationDAO the versionsRelationDAO to set
+        */
+       public void setVersionsRelationDAO(VersionsRelationDAO versionsRelationDAO) {
+               _versionsRelationDAO = versionsRelationDAO;
+       }
 }