67,513
社区成员
发帖
与我相关
我的任务
分享
<?xml version="1.0" encoding="GBK"?>
<project name="superTalk构建脚本" default="生成Hibernate配置文件" basedir=".">
<property name="src.dir" value="${basedir}/src"/>
<property name="xdoclet.home" value="D:/xdoclet-plugins-1.0.3"/>
<property name="lib.dir" value="${basedir}/lib"/>
<property name="class.root" value="../bin"/>
<!-- 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>
<path id="classpath">
<pathelement location="${class.root}" />
<fileset dir="${lib.dir}">
<include name="*.jar"/>
</fileset>
</path>
<taskdef
name="xdoclet"
classname="org.xdoclet.ant.XDocletTask"
classpathref="xdoclet.task.classpath"
/>
<taskdef name="schemaexport"
classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
classpathref="classpath"
/>
<target name="生成Hibernate配置文件">
<xdoclet>
<fileset dir="${src.dir}/cn/cupoy/supertalk/server/model">
<include name="**/*.java"/>
</fileset>
<component
classname="org.xdoclet.plugin.hibernate.HibernateConfigPlugin"
destdir="${basedir}/conf"
version="3.0"
hbm2ddlauto="update"
jdbcurl="jdbc:mysql://127.0.0.1/superTalk"
jdbcdriver="com.mysql.jdbc.Driver"
jdbcusername="root"
jdbcpassword=""
dialect="org.hibernate.dialect.MySQLDialect"
showsql="true"
/>
</xdoclet>
</target>
<target name="生成hibernate映射文件">
<xdoclet>
<fileset dir="${src.dir}/cn/cupoy/supertalk/server/model">
<include name="**/*.java"/>
</fileset>
<component
classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
version="3.0"
destdir="${src.dir}"
/>
</xdoclet>
</target>
<target name="schemaexport" description="生成数据库Schema">
<schemaexport properties="${basedir}/conf/hibernate.cfg.xml"
quiet="no"
text="true"
drop="no"
delimiter=";"
output="${basedir}/sql/schema-export.sql">
<fileset dir="${src.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaexport>
</target>
</project>
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://127.0.0.1/superTalk</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<mapping resource="cn/cupoy/supertalk/server/model/User.hbm.xml"/>
</session-factory>
</hibernate-configuration>
加载中
试试用AI创作助手写篇文章吧