\r
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;\r
\r
+import org.argeo.slc.core.structure.tree.TreeSPath;\r
import org.argeo.slc.core.test.NumericTRId;\r
import org.argeo.slc.core.test.TestResult;\r
import org.argeo.slc.core.test.TestResultId;\r
-import org.argeo.slc.dao.test.TestResultDao;\r
+import org.argeo.slc.core.test.tree.TreeTestResult;\r
+import org.argeo.slc.dao.test.tree.TreeTestResultDao;\r
\r
/**\r
* The Hibernate implementation for tree-based result of the test result dao.\r
* @see TreeTestResult\r
*/\r
public class TestResultDaoHibernate extends HibernateDaoSupport implements\r
- TestResultDao {\r
+ TreeTestResultDao {\r
\r
public void create(TestResult testResult) {\r
getHibernateTemplate().save(testResult);\r
getHibernateTemplate().saveOrUpdate(testResult);\r
}\r
\r
- public TestResult getTestResult(TestResultId id) {\r
- NumericTRId ntrid = (NumericTRId) id;\r
+ public TreeTestResult getTestResult(String uuid) {\r
List<?> list = getHibernateTemplate().find(\r
- "from TreeTestResult where numericResultId.value=?",\r
- ntrid.getValue());\r
+ "from TreeTestResult where uuid=?", uuid);\r
if (list.size() == 0) {\r
return null;\r
} else {\r
- return (TestResult) list.get(0);\r
+ return (TreeTestResult) list.get(0);\r
}\r
\r
}\r
\r
- public List<TestResult> listTestResults() {\r
- return (List<TestResult>) getHibernateTemplate().find(\r
+ public List<TreeTestResult> listTestResults() {\r
+ return (List<TreeTestResult>) getHibernateTemplate().find(\r
"from TreeTestResult");\r
}\r
\r
+ public List<TreeTestResult> listResults(TreeSPath path) {\r
+ List<TreeTestResult> list = getHibernateTemplate().find(\r
+ "from TreeTestResult res where ? in indices(res.resultParts)",\r
+ path.getAsUniqueString());\r
+ return list;\r
+ }\r
+\r
}\r