\r
public abstract String saveTaxonName(TaxonNameBase taxonName);\r
\r
- public abstract List<TaxonNameBase> getAllNames(int limit);\r
+ public abstract List<TaxonNameBase> getAllNames(int limit, int start);\r
\r
public abstract List<TaxonNameBase> getNamesByName(String name);\r
\r
return super.saveCdmObject(taxonName);\r
}\r
\r
- public List getAllNames(int limit){\r
- return dao.list(limit);\r
+ public List getAllNames(int limit, int start){\r
+ return dao.list(limit, start);\r
}\r
\r
}\r
return dao.find(title);\r
}\r
\r
- protected List<T> list(Integer limit) {\r
- return dao.list(limit);\r
+ protected List<T> list(int limit, int start) {\r
+ return dao.list(limit, start);\r
}\r
\r
}\r
import java.util.List;\r
\r
import org.apache.log4j.Logger;\r
+import org.hibernate.Criteria;\r
+import org.hibernate.Query;\r
import org.hibernate.Session;\r
import org.hibernate.SessionFactory;\r
import org.springframework.beans.factory.annotation.Autowired;\r
return true;\r
}\r
\r
- public List<T> list(Integer limit) {\r
- // TODO Auto-generated method stub\r
- return null;\r
+ public List<T> list(int limit, int start) {\r
+ Session s = getSession();\r
+ Criteria crit = s.createCriteria(type); \r
+ crit.setFirstResult(start);\r
+ crit.setMaxResults(limit);\r
+ List<T> entities = crit.list(); \r
+ return entities; \r
}\r
\r
+ public List<CdmBase> executeHsql(String hsql){\r
+ Query q = getSession().createQuery(hsql);\r
+ return q.list();\r
+ }\r
\r
+ \r
/* (non-Javadoc)\r
* @see eu.etaxonomy.cdm.persistence.dao.IDao#find(java.lang.String)\r
*/\r
public abstract List<T> find(String queryString);\r
+ \r
}\r
public Boolean exists(String uuid);
-//********************************************//
-
-
- /**
- * @param queryString
- * @return List<T extends CdmBase>
- * list object by searching on their title/lable.
- * common.Identifyable.getTitleCache if existing
- */
public List<T> find(String queryString);
- public List<T> list(Integer limit);
+ public List<CdmBase> executeHsql(String hsql);
+
+ public List<T> list(int limit, int start);
}