Hi all
When I use the code generator to create POJOs and mapping files from my schema, the generator class selected for auto_increment columns is always specified as 'assigned' when I think it should be 'identity'
eg my table might be
Code:
CREATE TABLE `team_manager` (
`team_manager_id` int(10) unsigned NOT NULL auto_increment,
a snippet from the mapping file created is
Code:
<id name="teamManagerId" type="int">
<column name="team_manager_id" />
<generator class="assigned" />
</id>
With it specified as assigned, the key field in my POJO is not being populated (understandably) when a new TeamManager object is persisted. When I change it to identity all is OK.
Is there a way to force the code generator to always specify <generator class="identity" /> instead of <generator class="assigned" /> when reverse engineering auto_increment columns?
Is there any other hibernate or MySQL setting I can modify?