For my Seam app, I use Hibernate Tools (hbm2java) via 'seam generate-entities' command to reverse engineer my tables.
I am using sqljdbc.jar (MSSQL 2005 RDBMS) version 1.2.
I noticed that the following line is always omitted in the entity class that is generated for a table that has an identity column as PK (i.e. auto-generated/incremented PK int):
Code:
@GeneratedValue(strategy=GenerationType.IDENTITY)
So I end up with an entity class like this:
Code:
@Entity
public class Inventory implements Serializable {
@Id
private long id;
...
}
Is there a way I can instruct hbm2java to include the @GenerateValue annotation in the entity class which is based on table with identity PK? If yes, how?
Currently, I must add this code manually...