Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Modulated PK column creating problem in CREATE

Hi,
I have a table which does not have PrimaryKey. But I have to declare a column as PK by this annotations:
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "UserKeyfield")

When I am performing an INSERT in this table using JPQL I am getting exception as null value can not be inserted into database for the column "UserKeyfield". I have checked that my Java object representing that table is having that PK value but while inserting it is just not getting inserted. May be because it is defined as "@GeneratedValue(strategy = GenerationType.IDENTITY)".

Is there any workaround to explicitely add the PK value while inserting the object into database?

--
Tanujit Chowdhury

Back to the top