PK value assigned to the object is ignored if @GeneratedValue(strategy
= GenerationType.IDENTITY) is specified.
On 8/16/2010 11:32 AM, Tanujit Chowdhury wrote:
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
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
|