Hi,
I'm using Seam 2.0.2.SP1 on JBoss 4.2.3 with a Sun 1.5.18 JDK.
I have an entity with a generated id as follows:
@Id @Column(name = "ENTITY_ID", unique = true, nullable = false) @NotNull public int getEntityId() { return this.entityId; }
When I use the form (generated by seam with reverse engineering from database) to create a new entity, hibernate tries to specify the entity id in the INSERT statement and the database (Apache Derby 10.4.2) throws an exception, complaining that Attempt to modify an identity column
.
I have manually removed the field for specifying the entity id from the form, but I suspect that seam inserts a default value (probably zero) there. How can I fix this?
Sorry for asking in the first place. Apparently the @GeneratedValue annotation was not created for the entity bean. Adding it fixed things...