Overview:
Basic requirements. Use the asp.net mvc Framework and ajax extjs to add, delete, modify, and query simple objects. The database access layer uses the nhib.pdf technology.
Specific Project Description: includes the following four projects
(1) SystemConfigMVCDemo. Entity
Model layer,
The BaseObject class is the parent class of all the child entity classes. The Equals () and GetHashCode () methods are rewritten because all users who have used NHibernate know that, the entity classes mapped to all databases of nhib.pdf must override these two methods. In the following example, in addition to the object class and parent class, there are also mapping Files. The attribute of the mapping file must be remembered here. The Build Action must be Embedded Resource.
(2) SystemConfigMVCDemo. DAO
Dao layer, connected to the database through nhib.pdf, used for specific operations in the database.
The HibernateAccess class constructs sessions through the configuration file, and then adds, deletes, modifies, queries, and other operations through session calls. HibernateDAO has HibernateAccess instances and implements methods in the IBussinessDAO interface. SystemConfigDAO inherits the HibernateDAO class. Therefore, you can add, delete, and modify databases directly.
(3) SystemConfigMVCDemo. Service
SystemConfigService class implementation Interface
(4) SystemConfigMVCDemo. Bussiness