XDoclet使用:
下载http://xdoclet.codehaus.org/
Ant+XDoclet:
在工程里创建一个需要映射的对象
<?xml version="1.0" encoding="GBK"?>
<!-- Build classpath -->
name="xdoclet"
classname="org.xdoclet.ant.XDocletTask"
classpathref="xdoclet.task.classpath"
/>
<!--
classname="org.xdoclet.plugin.hibernate.HibernateConfigPlugin"
destdir="${src.dir}"
version="3.0"
hbm2ddlauto="update"
jdbcurl="jdbc:mysql://127.0.0.1/storm"
jdbcdriver="com.mysql.jdbc.Driver"
jdbcusername="root"
jdbcpassword="123456"
dialect="org.hibernate.dialect.MySQLDialect"
showsql="true"
mergecfgxml="${basedir}/hibernate.cfg.xml"
/>
classname="org.xdoclet.plugin.hibernate.HibernateConfigPlugin"
destdir="${src.dir}"
version="3.0"
jdbcurl="jdbc:mysql://localhost/oa"
jdbcdriver="com.mysql.jdbc.Driver"
jdbcusername="root"
jdbcpassword="root"
dialect="org.hibernate.dialect.MySQLDialect"
showsql="true"
/>
-->
classname="org.xdoclet.plugin.hibernate.HibernateConfigPlugin"
destdir="${src.dir}"
version="3.0"
hbm2ddlauto="update"
jdbcurl="jdbc:mysql://127.0.0.1/storm"
jdbcdriver="com.mysql.jdbc.Driver"
jdbcusername="root"
jdbcpassword="123456"
dialect="org.hibernate.dialect.MySQLDialect"
showsql="true"
/>
classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
version="3.0"
destdir="${src.dir}"
/>
下载http://xdoclet.codehaus.org/
Ant+XDoclet:
在工程里创建一个需要映射的对象
<?xml version="1.0" encoding="GBK"?>
<!-- Build classpath -->
name="xdoclet"
classname="org.xdoclet.ant.XDocletTask"
classpathref="xdoclet.task.classpath"
/>
<!--
classname="org.xdoclet.plugin.hibernate.HibernateConfigPlugin"
destdir="${src.dir}"
version="3.0"
hbm2ddlauto="update"
jdbcurl="jdbc:mysql://127.0.0.1/storm"
jdbcdriver="com.mysql.jdbc.Driver"
jdbcusername="root"
jdbcpassword="123456"
dialect="org.hibernate.dialect.MySQLDialect"
showsql="true"
mergecfgxml="${basedir}/hibernate.cfg.xml"
/>
classname="org.xdoclet.plugin.hibernate.HibernateConfigPlugin"
destdir="${src.dir}"
version="3.0"
jdbcurl="jdbc:mysql://localhost/oa"
jdbcdriver="com.mysql.jdbc.Driver"
jdbcusername="root"
jdbcpassword="root"
dialect="org.hibernate.dialect.MySQLDialect"
showsql="true"
/>
-->
classname="org.xdoclet.plugin.hibernate.HibernateConfigPlugin"
destdir="${src.dir}"
version="3.0"
hbm2ddlauto="update"
jdbcurl="jdbc:mysql://127.0.0.1/storm"
jdbcdriver="com.mysql.jdbc.Driver"
jdbcusername="root"
jdbcpassword="123456"
dialect="org.hibernate.dialect.MySQLDialect"
showsql="true"
/>
classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
version="3.0"
destdir="${src.dir}"
/>
在myeclipse中使用ant控制台,添加build.xml,运行生成hibernate配置文件
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26495863/viewspace-1561555/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26495863/viewspace-1561555/