Pile configuration: 1) hibernate / xdoclet ant 2) spring hibernate: datasource, sessionFactory, transactionManager, dao, daoProxy, service 3) web: servlet (ContextLoaderServlet, DispatcherServlet, MyServlet- serviceFacade for setting the WebApplicationContext, so Service layer uses injections) mapping ...
Tired of mourning home ~~
1. JDK cannot be placed in the Chinese path, otherwise it can be debugged (connecting VM failed).
2. # hibernate.connection.driver_class org.gjt.mm.mysql.driver (does not support transaction)
Hibernate.connection.driver_class com.mysql.jdbc.driver (support transaction)
3. Net.sf.hibernate.tool.hbm2ddl.schemaexport fails in Ant (Class Can't find, strange).
Write a class instead of execution, put it in Ant, and the parameters are incompatched into the main function.
4. Eclipse Chinese, Eclipse Chinese package nlpack-eclipse-sdk-3.0.x-win32.zip Decompression to the corresponding directory If you are using Eclipse, you need to delete the Configuration and then start Eclipse. # Save the non-Java file, Chinese write file becomes "?? ...", but in the IDE, due to cache, it is displayed in Chinese, the next start will be garbled. (Version: 3.0.1 Construction Identification: 200409161125)
5. XDoclet pay attention
1) @ hibernate.property .... Property Type Remove the return type of the method, this property is invalid if there is no way.
2) Length is set to> 255, the type of mysql is Text.
6. XDoclet # Hibernate's ANT configuration
7. DAO uses dynamic agents to integrate the original DAO and transaction. Note that the DAO must be used in use because the actual agent class is not the original DAO class. Dynamic Proxy is an interface-oriented dynamic proxy implementation, and its agent object must be an implementation of an interface. CGLIB and Dynamic Proxy a proxy mechanism is basically similar, but its dynamically generated proxy object is not an implementation of an interface, but a subclass extension of the target class.
PS: BLOG editor is not good than before!