Construction of oa1--Environment

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.