What is Auto Sequence?
Auto Sequence is the ability to use the Oracle Database Sequence by the DataSource. With this feature, one can use Standard Oracle Database sequence for a primary key attribute.
When to use it?
You can use this feature, when you have a primary key attribute that you would like to populate using a sequence. This is tipically used for non-API backed datasource where the Platform manages the DMLs. This is also very usefull if you use other databases, other than Oracle, for you application schema where there is no support for a Sequence value.
How to setup an Auto Sequence?
- Create a database sequence in the platform schema
Note: You must create the sequence in the platform schema e.g. XXRA. If you use Oracle Database for the application schema and if the sequence already exists in the other Oracle Schema, then create a synonym for the existing sequence in XXRA schema.
- Select the datasource for which you need to setup Auto Sequence
- Check the Auto Sequence property
- Enter the sequence name in the Default Value field
- Save and verify by create a new record. The Auto Sequence enabled column should have a value populated from the given sequence.
- In case if Application Schema is in MYSQL or SQL SERVER then you need not specify the default value.
- Tick the primary key field and auto sequence property alone.