DomainCreateGenerated

annotation class DomainCreateGenerated(val key: String = "")(source)

Marks a constructor property as generated by the application on creation instead of user-supplied.

The value is produced by a dev.buijs.stratastax.entity.core.spi.TypeGenerator. A key is required when multiple properties have the same type but need different generators, or to replace a built-in generator for one property. When blank, the key is derived from the type as "generate{Type}". For example:

@DomainCreateGenerated("ownerId")
val ownerId: Long

The generator must declare the same key:

internal class GenerateOwnerId : TypeGenerator<Long>("ownerId") {
override fun generate(): Long = ...
}

Mutually exclusive with PersistenceGenerated. When combined with DomainUpdateGenerated, both must use the same key.

Properties

Link copied to clipboard
val key: String