I did more digging and it seems that it not generating the wrong SQL, it generates two versions and is picking the wrong version. There is an insert and an identity insert. It is incorrectly picking the insert version.
mvfranz wrote:
Hi,
I have an entity bean that uses the Id column with an auto generated value. This is running with MS SQL 2005 and works fine in a standalone application using Jdk 1.6.0_18. When I try to use the same jar inside of NetBeans RCP the insert statements are created incorrectly. The insert includes the ID_COVER as a value that needs to be provide.
The annotations is:
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "ID_COVER")
private Long idCover;
I am using hibernate version 3.2.1 and the matching dependencies from the compatibility matrix. I have enabled the lowest level of logging and cannot see anything that indicates that it has an issue with this field. I am assuming that this is some kind of a runtime classpath issue, but have no idea what I could be missing. Reads and updates work fine.
Any pointers is appreciated.
Michael