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();
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;
// 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
// ==============================================================================================================================
// 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