]> SALOME platform Git repositories - tools/siman.git/commitdiff
Salome HOME
Fix of hibernate exception when loading on empty database.
authorrkv <rkv@opencascade.com>
Thu, 14 Mar 2013 08:56:37 +0000 (08:56 +0000)
committerrkv <rkv@opencascade.com>
Thu, 14 Mar 2013 08:56:37 +0000 (08:56 +0000)
Workspace/Siman-Common/src/org/splat/service/KnowledgeElementTypeServiceImpl.java
Workspace/Siman-Common/src/org/splat/service/technical/ProjectSettingsServiceImpl.java

index db8e4cf9c13e2f95599f6255c8268cb7d61fac2e..e95291eb338a88bf1c261fa68fc75f31cdcffde7 100644 (file)
@@ -46,6 +46,7 @@ public class KnowledgeElementTypeServiceImpl implements
         *            the new type name
         * @return the created knowledge type
         */
+       @Transactional
        public KnowledgeElementType createType(final String name) {
                KnowledgeElementType kelt = getKnowledgeElementTypeDAO()
                                .findByCriteria(Restrictions.eq("name", name));
@@ -63,6 +64,7 @@ public class KnowledgeElementTypeServiceImpl implements
         * 
         * @return the list of all knowledge types
         */
+       @Transactional
        public List<KnowledgeElementType> selectAllTypes() {
                return getKnowledgeElementTypeDAO().getAll(Order.asc("rid"));
        }
@@ -74,6 +76,7 @@ public class KnowledgeElementTypeServiceImpl implements
         *            the progress state
         * @return the list of found knowledge types
         */
+       @Transactional
        public List<KnowledgeElementType> selectTypesWhere(final ProgressState state) {
                return getKnowledgeElementTypeDAO().getFilteredList(
                                Restrictions.eq("state", state), Order.asc("rid"));
@@ -86,6 +89,7 @@ public class KnowledgeElementTypeServiceImpl implements
         *            the knowledge type name
         * @return the found knowledge type
         */
+       @Transactional
        public KnowledgeElementType selectType(final String name) {
                return getKnowledgeElementTypeDAO().findByCriteria(
                                Restrictions.eq("name", name));
@@ -98,6 +102,7 @@ public class KnowledgeElementTypeServiceImpl implements
         *            the id of a knowledge type
         * @return the found knowledge type
         */
+       @Transactional
        public KnowledgeElementType selectType(final long index) {
                return getKnowledgeElementTypeDAO().get(index);
        }
index f079a5afd2c5a16ebbccebaf452e1163e50dc286..926195b10ef5b784e3507c73eb687d2df81dca3e 100644 (file)
@@ -420,6 +420,7 @@ public class ProjectSettingsServiceImpl implements ProjectSettingsService,
        /**
         * Initialize the database: create all necessary default staff defined in the configuration file.
         */
+       @Transactional
        protected void initialize() {
                createDocumentTypes();
                createSimulationContextTypes();
@@ -867,6 +868,7 @@ public class ProjectSettingsServiceImpl implements ProjectSettingsService,
        /**
         * Create in the database knowledge types defined in the custom configuration.
         */
+       @Transactional
        private void createKnowledgeElementTypes() {
                try {
                        KnowledgeElementType ktype = getKnowledgeElementTypeService()