zero_coding
08/30/2020, 8:50 AMtransaction and later do the transaction.Kenneth Wußmann
08/31/2020, 7:45 AMnew already wants to create the Gender in the database. That’s why you need a transaction.
I guess you could instantiate a Gender yourself:
val g = Gender(EntityID("M", Genders))
Which would imply that a Gender with id M already exists. But usually you would either insert or select to get an instance.
So rather:
val g = transaction { Gender.findById("M") }