← Back to Stormify Documentation

primarySequence

The name of the database sequence used to generate primary key values.

Only applicable for databases that support sequences (Oracle, PostgreSQL). Leave empty for auto-increment/IDENTITY columns (MySQL, SQL Server).

Examples:

// PostgreSQL sequence
@DbField(primaryKey = true, primarySequence = "user_id_seq")
var id: Int = 0

// Oracle sequence
@DbField(primaryKey = true, primarySequence = "USER_SEQ")
var id: Int = 0

// MySQL auto-increment (no sequence)
@DbField(primaryKey = true)
var id: Int = 0

Return

the sequence name, or empty string if not using sequences