Since version 2.3.0 of the anorm library of play framework, the trait Pk
is deprecated and it suggests the usage of its subclasses Id
and NotAssigned
(documentation).
But what if we have a variable that can take either an Id
or a NotAssiged
?
Specifically, in my code I have a class Person(id: Pk[Long], name: String)
. Using Pk
as the type of id
, I can create new users like Person(NotAssigned, "kostas")
or get existing from my db Person(Id(3), "kostas")
.
How can I migrate my code to not use the deprecated Pk
trait, but hold the same functionality?