https://kotlinlang.org logo
#exposed
Title
# exposed
g

Gunslingor

04/02/2020, 5:58 PM
I'm still confused, anyone know how to set this up correctly for DB instantiation? I can't get these entity objects right with Id Tables and such...
Copy code
object Users : IdTable<String>() {
    val username = varchar("username",255)
    val email = varchar("email",255)
    val created = datetime("created").nullable()
    val passwordHash = varchar("passwordHash",255).nullable()
    val passwordSalt = varchar("passwordSalt",255).nullable()
    val avatar = varchar("avatar",255).nullable()          //path to users picture
    val type = varchar("type",45).nullable()               //normal or primium
    override val primaryKey = PrimaryKey(username, name = "PK_User_username")
    override val id: Column<EntityID<String>>
    get() = TODO("Not yet implemented")
}
class User(username: Entity<String>) : EntityClass<String, Users>(){

}
val defaultUsers = listOf<String>()
Not sure why intelliJ is automatically wanting to add the last two lines to the Users object either.... I thought getters and setters were predefined in exposed?
Well took an hour but I got it, use strings not entity id like examples.
But I guess that means I can't do entity.new like the examples.
I'm talking to myself in this deserted forum of deserted deserts 😃