kotlinConvention

Parameters

kotlinConvention

Naming convention for enum values in Kotlin

Examples

// Example 1: Using default naming convention
// `OrderStatus` class will be mapped to `order_status` type in PostgreSQL.
// Values (Pending, Completed) will be mapped as 'PENDING', 'COMPLETED'.
@PgEnum
enum class OrderStatus { Pending, Completed }

// Example 2: Explicit type name specification and different value convention
// `PaymentMethod` class will be mapped to `payment_method_enum` type.
// Values (CreditCard) will be mapped as 'credit_card'.
@PgEnum(name = "payment_method_enum", pgConvention = CaseConvention.SNAKE_CASE_LOWER)
enum class PaymentMethod { CreditCard, BankTransfer }