← Back to Stormify Documentation

PropertyMeta

class PropertyMeta<T : Any>(val name: String, val type: KClass<*>, val isReference: Boolean, val getter: (T) -> Any?, val setter: (T, Any?, Stormify) -> Unit, val dbNameOverride: String?, val isPrimaryKey: Boolean, val sequence: String?, val isAutoIncrement: Boolean = false, val isCreatable: Boolean = true, val isUpdatable: Boolean = true, val isTransient: Boolean = false, val isEnum: Boolean = false, val enumAsString: Boolean = false)

Describes a single property of an entity class, including its type, getter/setter lambdas, and database mapping overrides. Used by EntityMeta and the annotation processor.

Constructors

Link copied to clipboard
constructor(name: String, type: KClass<*>, isReference: Boolean, getter: (T) -> Any?, setter: (T, Any?, Stormify) -> Unit, dbNameOverride: String?, isPrimaryKey: Boolean, sequence: String?, isAutoIncrement: Boolean = false, isCreatable: Boolean = true, isUpdatable: Boolean = true, isTransient: Boolean = false, isEnum: Boolean = false, enumAsString: Boolean = false)

Properties

Link copied to clipboard

explicit database column name, or null to use the NamingPolicy

Link copied to clipboard

whether enum values are stored as their string name (true) or ordinal/custom integer (false)

Link copied to clipboard
val getter: (T) -> Any?

lambda to read the property value from an entity instance

Link copied to clipboard

whether the database auto-generates this value (IDENTITY columns)

Link copied to clipboard

whether this property is included in INSERT statements

Link copied to clipboard

whether the property type is a Kotlin/Java enum

Link copied to clipboard

whether this property is part of the primary key

Link copied to clipboard

whether this property is a foreign key reference to another entity

Link copied to clipboard

whether this property should be excluded from all database operations

Link copied to clipboard

whether this property is included in UPDATE statements

Link copied to clipboard

the Kotlin property name

Link copied to clipboard

the database sequence name for auto-generation, or null

Link copied to clipboard
val setter: (T, Any?, Stormify) -> Unit

lambda to write a value into the property, with type conversion via Stormify

Link copied to clipboard
val type: KClass<*>

the property's Kotlin type