public List<T> findAll() { Type genType = getClass().getGenericSuperclass(); Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); return dao.all((Class<T>) params[0]); }
public T findByPk(Object pk) { Type genType = getClass().getGenericSuperclass(); Type[] params = ((ParameterizedType) genType).getActualTypeArguments(); return dao.unique((Class<T>) params[0], pk); }
public int delete(Object pk) { return dao.deleteById(this.getClass(), pk); }
public int insert() { return dao.insert(this.getClass(), this); }
public int update() { return dao.updateById(this); }