Since version 2.3.0 of the game structure anorm library, the Pk attribute is deprecated and suggests the use of its subclasses Id and NotAssigned ( documentation ).
But what if we have a variable that can accept either Id or NotAssiged ? In particular, in my code there is a class Person(id: Pk[Long], name: String) . Using Pk as an Id type, I can create new users such as Person(NotAssigned, "kostas") or get an existing one from my db Person(Id(3), "kostas") .
How can I port my code so as not to use the deprecated Pk trait, but stick to the same functionality?
scala playframework anorm
kwstas
source share