ValidationException.nullPrimaryKeyInUnitOfWorkClone Exception When Using Zero as a Primary Key (Doc ID 1536334.1)

Last updated on MARCH 06, 2017

Applies to:

Oracle TopLink - Version 11.1.1.6.0 and later
Information in this document applies to any platform.

Symptoms

An entity UsuarioAux is defined mapping to this database table :

CREATE TABLE USUARIO_AUX (
ID NUMBER NOT NULL PRIMARY KEY,
NOMBRE VARCHAR(32),
APELL1 VARCHAR(32),
APELL2 VARCHAR(32)
);

One row has been inserted with a primary key id equal to 0 :

INSERT INTO USUARIO_AUX VALUES (0,'PRUEBA','PRUEBA','PRUEBA');



After fetching the UsuarioAux with ID equal to 0 , this entity is updated with the following code
 (where  UsuarioAux usuario is containing the new attribute values of the entity ) :

 

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms