1 在goodspeed.web.model下創建*類(空的構造,屬性訪問與設置),同時配置*.hbm.xml文件與數據庫掛起來
2 在goodspeed.web.dao創建*Dao和*Daoimpl類(繼承HibernateDaoSupport),實現數據庫操做
*Daoimpl能夠直接返回List<*>等
3 在applicationContext.xml中建一個bean
<bean id="*Dao" class="goodspeed.web.dao.*DaoImpl">
<property name="sessionFactory"><ref bean="sessionFactory" /></property>
</bean>
4 相應Service若是須要*Dao只須要高架對*Dao的引用便可web