Hello experts.
I am sure this might have been solved but unable to find a solution as all available documents are referring to sequence numbers and DB triggers.
I have the following table created in Oracle 12c:
CREATE TABLE "SYSTEM"."SYNC_META_DEFN"
( "SYNC_ID" NUMBER GENERATED ALWAYS AS IDENTITY MINVALUE 1 MAXVALUE 99999999999999999999 INCREMENT BY 1 START WITH 1 CACHE 20 NOORDER NOCYCLE NOT NULL ENABLE,
"SYNC_STATUS" VARCHAR2(20 BYTE),
CONSTRAINT "SYNC_META_DEFN_PK" PRIMARY KEY ("SYNC_ID")
**Snip****
I created a Entity and view from this table and the SYNC_ID is now marked as BigDecimal.
Now I do the following:
1. Rest request - POST: without specifying the SYNC_ID (as it will be auto generated by DB) and get a validation error
Exception in thread "main" oracle.jbo.AttrValException: JBO-27014: Attribute SyncID in syncMetaDefn is required.
Question: I am sure I am missing something here and any pointers? What needs to be done so that the jbo skips the validation for the identity column (i feel it feels that SyncID is mandatory as it is a primary key)
2. Added a dummy value to the SYNC_ID in the rest request and now it passes validation but throws SQL error
Exception in thread "main" oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Insert": SQL Statement *****
Caused by: java.sql.SQLException: ORA-32795: cannot insert into a generated always identity column
This is the expected behavior as the SQL formed is trying to insert a value into an identity field.