I’m using MyBatis Generator in Eclipse Helios (MyBatis Generator 1.3.1.201101032122)but every time I generate automatically the persistent classes the generator removes the attribute useGeneratedKeys=”true”.
So for example I have the tag in my AdresseMapper.xml. After I changed something in my db and I run ‘Generate MyBatis Artifacts’ this tag is overwritten and useGeneratedKey isn’t there anymore…When I remove WARNING – @mbggenerated, there is a conflict between a new generated insert(without the attribute) and the old version…
Could you kindly help me? I didn’t find anything in the official doc..
Many thanks
Fabio
The MyBatis Generator must know which column has generated keys. You can do that using the
generatedKeytag inside thetabletag.Example: