View Javadoc

1   package org.whatsitcalled.webflange.model;
2   
3   import java.io.File;
4   import java.util.List;
5   
6   import org.apache.wicket.markup.html.link.DownloadLink;
7   import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
8   import org.whatsitcalled.webflange.ResourceFactory;
9   import org.whatsitcalled.webflange.file.FileManagerException;
10  
11  public class LoadTestRunDAOHibernate extends HibernateDaoSupport implements
12  		LoadTestRunDAO {
13  
14  	public LoadTestRun getLoadTestRun(Long id) {
15  		return (LoadTestRun) getHibernateTemplate().get(LoadTestRun.class, id);
16  	}
17  
18  	public void saveLoadTestRun(LoadTestRun run) {
19  		getHibernateTemplate().saveOrUpdate(run);
20  	}
21  
22  	public LoadTestRun getLoadTestRun(LoadTest test, long time) {
23  		String SQL = " from LoadTestRun as r where r.loadTest.id=? and r.time=?";
24  		Object[] params = new Object[2];
25  		params[0] = test.getId();
26  		params[1] = new Long(time);
27  		List runList = getHibernateTemplate().find(SQL, params);
28  		// System.out.println("Size=" + testList.size());
29  		return (LoadTestRun) runList.get(0);
30  	}
31  
32  	public void removeLoadTestRun(Long id) {
33  		LoadTestRun run = getLoadTestRun(id);
34  		getHibernateTemplate().delete(run);
35  	}
36  
37  }