← Back to Stormify Documentation

primaryKey

val primaryKey: Boolean = false

Whether this field is a primary key.

Set to true for primary key fields. For composite keys, mark all key fields with primaryKey = true.

Examples:

@DbField(primaryKey = true)
var id: Int = 0

// Composite key
@DbField(primaryKey = true) var orderId: Int
@DbField(primaryKey = true) var productId: Int

Return

true if this is a primary key field, false otherwise (default)