Hi ameelin,
Unfortunately, the problem is not one that can be truly solved by modifying the code generation templates. The problem is that the metadata returned from the database doesn’t contain the information necessary to determine that a particular field is auto-incremented. In fact, the persistence:generatedValue tag that you referenced is already trying to output the @GeneratedValue (GenerationType.IDENTITY) and is unable to detect the auto increment field.
Now if all of your key fields are auto-incremented, you could just put the desired text (@GeneratedValue (GenerationType.IDENTITY)) in the block:
<c:if test="$field/@primaryKey = 'true'">
<persistence:id select="$field" />
</c:if>
The persistence:id tag shown in the code block above outputs the @Id annotation.
Also, if you have any compound primary keys, there is a “DataTypeKey.jet” file that will need to have the same changes made.