i have created an ant target for schemaupdate which is
<taskdef name="schemaupdate"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaUpdateTask"
classpathref="project.classpath"/>
<schemaupdate
properties="config/hibernate.properties"
quiet="no">
<fileset dir="src">
<include name="**/*.hbm.xml"/>
</fileset>
</schemaupdate>
My hbm file looks like
<hibernate-mapping>
<class name="db.User" table="User">
<id name="id" type="long">
<generator class="seqhilo">
<param name="sequence">user_sequence</param>
<param name="max_lo">1</param>
</generate>
</id>
<property ...................
</class>
</hibernate-mapping>
When I do update hbm file, and run schemaupdate, I get exception. The exception occurs because of the statement "create sequence .." as the sequence already exists. Why schemaupdate generate "create sequence" instead of "update sequence"? How can i control this? Thanks in advance
|