I'd like to use an enum class to map some integer ...
# announcements
c
I'd like to use an enum class to map some integer constants to more readable names, e.g.:
Copy code
enum class Settings(val intValue: Int) {
    FOO_ENABLED(260),
    ...
}`
And then reference it from an SQL query that is the value of an annotation:
Copy code
@SQLQuery("""<sql stuff> and id = ${FOO_ENABLED.intValue}""")
But I can't because
intValue
isn't a compile-time constant, and I don't think I can make it be one (
const
is not allowed there). Is there an approach I'm not thinking of?