Fusion Developer's Guide for Oracle ADF
4.10.10 How to Get Trigger-Assigned Primary Key Values from a Database Sequence
To run the test case you need to create database trigger :
CREATE OR REPLACE TRIGGER LOCATIONS_PK
BEFORE INSERT
ON "LOCATIONS"
FOR EACH ROW
BEGIN
IF INSERTING
THEN
IF :NEW."LOCATION_ID" IS NULL
THEN
SELECT LOCATIONS_SEQ.NEXTVAL INTO :NEW."LOCATION_ID" FROM DUAL;
END IF;
END IF;
END;
When you try to insert second line, first line is dublicated, when testing activation safe.
Test case
No comments:
Post a Comment