Hello Community, is it possible to map bean's key field with identity primary key column in DB2? Sample table: CREATE TABLE ADDRESS ( ID INTEGER NOT NULL GENERATED BY DEFAULT AS IDENTITY ( START WITH 1 INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 NO CYCLE CACHE 20 NO ORDER ), Line1 VARCHAR(255) NOT NULL, Line2 VARCHAR(255), City VARCHAR(255) NOT NULL, Postcode VARCHAR(6) NOT NULL, Country VARCHAR(50) NOT NULL, Latitude DOUBLE, Longitude DOUBLE ) AUDIT NONE DATA CAPTURE NONE CCSID UNICODE;
ejbCreate methods have been tailored NOT TO set ID field, but it gets initialized with default for integer type - 0 so i'm getting DuplicateKeyException on second and following calls to ejbCreate. What is the best way to implement IDENTITY behavior? I found many examples for JBoss but nothing for WAS. It was easy with JPA, but CMP 2.0 is a must at this time