Appfuse框架小结
按照Appfuse2.1的文档http://java.net/projects/appfuse/downloads/download/appfuse-documentation-2.1.0.pdf如果你的DAO只是普通的CRUD(所需操作全部包含在GenericDAO中),则你只需要写好DAO对应的Entity即可。然后在hibernate.hbm.xml里注册一下你写的Entity(不管你是不是需要复杂的DAO,你都需要把你的Entity注册到这个文件里)。
然后在src/main/webapp/WEB-INF/applicationContext.xml里注册一个DAO如下:
在需要调用这个Service的地方,这样写:private GenericDao<InvoiceAppl, Long> invoiceApplDao;public void setInvoiceApplDao(GenericDao<InvoiceAppl, Long> invoiceApplDao){this.invoiceApplDao = invoiceApplDao;}