Ant+XDoclet的使用,自动化生成hibernate配置文件

XDoclet使用: 
下载http://xdoclet.codehaus.org/ 
Ant+XDoclet: 
在工程里创建一个需要映射的对象 




   
   



   
   
     
         
     

     
         
     

   

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"

/>







classname="org.xdoclet.plugin.hibernate.HibernateMappingPlugin"
version="3.0"
destdir="${src.dir}"
/>








在myeclipse中使用ant控制台,添加build.xml,运行生成hibernate配置文件

请使用浏览器的分享功能分享到微信等