Recently I have to make my current schema expose to other schema and allow it to insert new records, lets say table RECORD.
The RECORD table is managed by OpenJPA and it's id is auto generated
@GeneratedValue(strategy = GenerationType.AUTO)
and in openjpa persistence context
<property name="openjpa.Sequence" value="table(Table=SEQUENCE_TABLE, Increment=10)" />
and the sequence table is
CREATE TABLE "MYSCHEMA"."SEQUENCE_TABLE"
(
"ID" NUMBER(22,0) NOT NULL ENABLE,
"SEQUENCE_VALUE" NUMBER(22,0),
CONSTRAINT "SYS_C0012743" PRIMARY KEY ("ID")
);
my question is what is the safest way to let external schema retrieve the sequence for the insertions?