OA system I use is struts+hibernate+spring integrated development, the first thing to do is to add the corresponding jar package.
The next configuration file in this system I choose to use Ant+xdoclet automatic generation, so as to facilitate the change, only in the Pojo class to modify it, and do not need to be modified in the Pojo class and in the configuration file, to avoid unnecessary errors occur.
When using ant, it is necessary to add its corresponding jar package to the project, and the use of Xdoclet only needs to indicate its path in Build.xml. Build.xml as follows:
<?xml version= "1.0" encoding= "GBK"?>
<project name= "OA" 01 "System Build Script" default= "generates Hibernate profile" basedir= "." >
<property name= "Src.dir" value= "${basedir}/src"/>
<property name= "Xdoclet.home" value= "e:/ssh/xdoclet-plugins-dist-1.0.4-bin/xdoclet-plugins-dist-1.0.4"/>
<!--Build Classpath--
<path id= "Xdoclet.task.classpath" >
<fileset dir= "${xdoclet.home}/lib" >
<include name= "**/*.jar"/>
</fileset>
</path>
<taskdef
Name= "Xdoclet"
Classname= "Org.xdoclet.ant.XDocletTask"
classpathref= "Xdoclet.task.classpath"
/>
<target name= "Generate Hibernate Profile" >
<xdoclet>
<fileset dir= "${src.dir}/org/yebing/oa/model" >
<include name= "**/*.java"/>
</fileset>
<component
Classname= "Org.xdoclet.plugin.hibernate.HibernateConfigPlugin"
Destdir= "${src.dir}"
version= "3.0"
Hbm2ddlauto= "Create"
Jdbcurl= "Jdbc:mysql://127.0.0.1/oa"
Jdbcdriver= "Com.mysql.jdbc.Driver"
Jdbcusername= "Root"
Jdbcpassword= "ZWW"
dialect= "Org.hibernate.dialect.MySQLDialect"
Showsql= "true"
/>
</xdoclet>
</target>
<target name= "Generate Hibernate mapping File" >
<xdoclet>
<fileset dir= "${src.dir}/org/yebing/oa/model" >
<include name= "**/*.java"/>
</fileset>
<component
Classname= "Org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
version= "3.0"
Destdir= "${src.dir}"
/>
</xdoclet>
</target>
</project>
This basically completed the construction of the environment.