20.1.6. 用Ant来增量更新schema(Using Ant for incremental schema updates)

你可以在Ant脚本中调用SchemaUpdate

  1. <target name="schemaupdate">
  2. <taskdef name="schemaupdate"
  3. classname="org.hibernate.tool.hbm2ddl.SchemaUpdateTask"
  4. classpathref="class.path"/>
  5. <schemaupdate
  6. properties="hibernate.properties"
  7. quiet="no">
  8. <fileset dir="src">
  9. <include name="**/*.hbm.xml"/>
  10. </fileset>
  11. </schemaupdate>
  12. </target>