Hello, I have a Java object with a field that needs to be auto-incremented in the database. This field is not a primary key, just a field that needs to be auto-incremented.
My question is what value I need to set this field in my Java object before doing a session.save(Object)? Do I have to set it to NULL?
How would the Hibernate mapping look for this field? This is what I have but its not working:
<property name="reportNum" type="java.lang.Long">
<column name="REPORTNUM"/>
<generator class="increment"/>
</property>
Also the application needs to support both MySQL and SQL Server.
thanks in advance.