When using NetBeans 7 to generate entity classes from a database table, the entity classes are generated with the following annotations...
When persisting, bean validation fails because the autogenerated primary key is null at the time the object is persisted.
Netbeans have stated that they wont fix this as they see it as bean validation issue rather than their generated classes.
Related Forum posting is here...
Suggest modifying Bean Validation Pre-Persist to ignore @NotNull if @GeneratedValue exists.
Netbeans 7, Seam 3 under JBOSS AS 7