← Back to Stormify Documentation

autoIncrement

val autoIncrement: Boolean = false

Whether the field value is auto-generated by the database (e.g., AUTO_INCREMENT, SERIAL, IDENTITY).

When true, the field is excluded from INSERT statements and its value is read back after insertion. This is equivalent to JPA's @GeneratedValue(strategy = GenerationType.IDENTITY).

Examples:

@DbField(primaryKey = true, autoIncrement = true)
var id: Int = 0 // Excluded from INSERT, populated after insert

Return

true if the field value is auto-generated by the database, false otherwise (default)