81,092
社区成员
发帖
与我相关
我的任务
分享
public class RYTBaseDao<T> extends LibraDaoSupport {
Class<T> entityClass;
@SuppressWarnings("unchecked")
public RYTBaseDao() {
entityClass = (Class<T>) ((ParameterizedType) this.getClass()
.getGenericSuperclass()).getActualTypeArguments()[0];
}
public Integer save(T t) throws Exception {
return this.getSession().save(t);
}
public Integer update(T t) throws Exception {
return this.getSession().update(t);
}
public Integer delete(T t) throws Exception {
return this.getSession().delete(t);
}
public List<T> queryAll() {
return this.getSession().queryAll(entityClass);
}
}