]> SALOME platform Git repositories - tools/siman.git/blobdiff - Workspace/Siman/src/org/splat/simer/admin/ImportedStudy.java
Salome HOME
Siman codebase is refactored. Spring beans are introduced in the context.
[tools/siman.git] / Workspace / Siman / src / org / splat / simer / admin / ImportedStudy.java
index e53b2d7fea7e0a1f4c9bdd0e8c0495d23664dcb1..66afc6318df3b5906ee73490330368155a6a4852 100644 (file)
@@ -9,21 +9,26 @@ import java.util.List;
 
 import org.hibernate.Session;
 import org.hibernate.jdbc.Work;
-import org.splat.som.Database;
-import org.splat.som.Study;
+import org.splat.dal.dao.som.Database;
+import org.splat.dal.bo.som.Study;
+import org.splat.service.SearchService;
 
 
 public class ImportedStudy {
 
-    private int     rid;
+    private SearchService _searchService;
+       private int     rid;
     private String  sid;
     private String  title;
 
-    protected static class SelectStudies implements Work {
+    protected class SelectStudies implements Work {
 //  ----------------------------------------------------
 
       private List<ImportedStudy> table = new ArrayList<ImportedStudy>();
 
+      protected SelectStudies(SearchService searchService) {
+      }
+      
       public void execute (Connection connex) throws SQLException
       {
         Statement        request = connex.createStatement();
@@ -37,13 +42,14 @@ public class ImportedStudy {
           String title = result.getString("title");
           try {
             sprop.clear();
-            if (Database.selectStudiesWhere(sprop.setReference(sid)).size() != 0) continue;
+            if (getSearchService().selectStudiesWhere(sprop.setReference(sid)).size() != 0) continue;
           } catch (Exception error) {
                continue;
           }
           table.add( new ImportedStudy(rid, sid, title) );
         }
       }
+      
       public List<ImportedStudy> getResult ()
       {
        return table;
@@ -54,13 +60,16 @@ public class ImportedStudy {
 //  Constructor
 //  ==============================================================================================================================
 
-    public ImportedStudy (int rid, String sid, String title) {
-//  --------------------------------------------------------
-      this.rid   = rid;
-      this.sid   = sid;
-      this.title = title;
+    public ImportedStudy () {
     }
 
+    public ImportedStudy (int rid, String sid, String title) {
+    //  --------------------------------------------------------
+          this.rid   = rid;
+          this.sid   = sid;
+          this.title = title;
+        }
+
 //  ==============================================================================================================================
 //  Public member functions
 //  ==============================================================================================================================
@@ -82,12 +91,20 @@ public class ImportedStudy {
 //  Public services
 //  ==============================================================================================================================
 
-    public static List<ImportedStudy> selectAll () {
+    public List<ImportedStudy> selectAll () {
 //  ----------------------------------------------
       Session        session = Database.getSession();
-      SelectStudies  query   = new SelectStudies();
+      SelectStudies  query   = new SelectStudies(getSearchService());
       session.doWork(query);
 
       return  query.getResult();
     }
+
+       public org.splat.service.SearchService getSearchService() {
+               return _searchService;
+       }
+
+       public void setSearchService(SearchService searchService) {
+               _searchService = searchService;
+       }
 }
\ No newline at end of file