package com.lkk.lostfound.daoImpl;

import java.util.List;

import org.springframework.orm.hibernate3.HibernateTemplate;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;

import com.lkk.lostfound.dao.DaoBase;

public abstract class DaoBaseImpl<T> extends HibernateDaoSupport implements
		DaoBase<T> {
	protected HibernateTemplate hibernateTemplate = getHibernateTemplate();

	public T get(long entityId) {
		return (T) hibernateTemplate.get(getEntityClass(), entityId);
	}

	public void update(T entity) {
		hibernateTemplate.update(entity);
	}

	public Integer save(T entity) {
		return (Integer) getHibernateTemplate().save(entity);
	}

	public void delete(long entityId) {
		hibernateTemplate.delete(get(entityId));
	}


	public List<T> getAll() {
		return null;
	}

	public List<T> getPartial(int pageSize, int pageIndex) {
		return null;
	}

	public List<T> Query(String queryString) {
		return null;
	}

	abstract Class getEntityClass();
}

@@ -738,17 +738,16 @@
 ));%0A%09%7D%0A%0A
-%0A
 %09public 
@@ -766,36 +766,86 @@
 ll() %7B%0A%09%09return 
-null
+hibernateTemplate.find(%22find %22 + getEntityClassName())
 ;%0A%09%7D%0A%0A%09public Li
@@ -951,24 +951,24 @@
 ryString) %7B%0A
-
 %09%09return nul
@@ -974,16 +974,98 @@
 ll;%0A%09%7D%0A%0A
+%09protected String getEntityClassName() %7B%0A%09%09return getEntityClass().getName();%0A%09%7D%0A%0A
 %09abstrac

添加实现了getAll函数，主要为了前期开发的调试