ITPub博客

首页 > 应用开发 > Java > Ant+XDoclet的使用,自动化生成hibernate配置文件

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

原创 Java 作者:xinlieboy 时间:2015-04-10 11:20:52 0 删除 编辑
XDoclet使用: 
下载http://xdoclet.codehaus.org/ 
Ant+XDoclet: 
在工程里创建一个需要映射的对象 




   
   



    <!-- 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博客 ” ,链接:https://blog.itpub.net/26495863/viewspace-1561555/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-11-22

  • 博文量
    65
  • 访问量
    316107