Home > Database > Mysql Tutorial > ant 生产hibernater配置文件跟映射文件 mysql为例_MySQL

ant 生产hibernater配置文件跟映射文件 mysql为例_MySQL

WBOY
Release: 2016-06-01 13:11:37
Original
747 people have browsed it

Hibernate

<?xml version="1.0" encoding="GBK"?><!-- default 默认的target   basedir表示路径--><project name="OA系统构建脚本" default="生成Hibernate配置文件" basedir=".">   	<property name="src.dir" value="${basedir}/src"/>   	<property name="build.dir" value="${basedir}/bin"/>	<property name="xdoclet.home" value="G:/java/ant/xdoclet-plugins-1.0.3"/>   	<!-- Build classpath -->   	<path id="xdoclet.task.classpath">      	<fileset dir="${xdoclet.home}/lib">         	<include name="**/*.jar"/>      	</fileset>      	<fileset dir="${xdoclet.home}/plugins">         	<include name="**/*.jar"/>      	</fileset>   	</path>	<taskdef 		name="xdoclet"		classname="org.xdoclet.ant.XDocletTask"		classpathref="xdoclet.task.classpath"	/>		<!--任务 target-->	<target name="生成Hibernate配置文件">		<xdoclet>			<fileset dir="${src.dir}/com/fqh/javaBean">				<include name="**/*.java"/>			</fileset>						<component				classname="org.xdoclet.plugin.hibernate.HibernateConfigPlugin"				destdir="${src.dir}"				version="3.0"				hbm2ddlauto="update"				jdbcurl="jdbc:mysql://127.0.0.1/fqh"				jdbcdriver="com.mysql.jdbc.Driver"				jdbcusername="root"				jdbcpassword="root"				dialect="org.hibernate.dialect.MySQLDialect"				showsql="true"			/>		</xdoclet>	</target>	<target name="生成hibernate映射文件">		<xdoclet>			<fileset dir="${src.dir}/com/fqh/javaBean">				<include name="**/*.java"/>			</fileset>			<component 				classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"				version="3.0"				destdir="${src.dir}"			/>		</xdoclet>	</target></project>
Copy after login


source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template