這個模塊用作從實體類-->hbm.xml-->數據庫,用于配合我的測試驅動開發。寫的時候挺麻煩,但寫好了就一勞永逸了。
this is a common hibernate mapping file builder.it needs parameters below:
fileset.hibernate.models : model objects need to generate mapping files.(fileset type)
classpath : classpath that those model objects depend on.(path type)
dependent optional task : xdoclet.modules.hibernate.HibernateDocletTask must be added to your build path.
src.hibernate : where to put generated mapping files.
example:
用到的時候,import到build.xml就行了,schemaexport任務要一個hibernate.properties文件,內容如下:
hibernate.connection.driver_class=driver name
hibernate.connection.url=url
hibernate.connection.username=user name
hibernate.connection.password=password
hibernate.dialect=org.hibernate.dialect.MySQLDialect
像這樣子的,每個項目都會用到的ant script還有挺多的如javadocs等,獨立出來非常方便,呵呵。