I would like to introduce a model object for an Ebean project using scala and freemework Play 2.2. I am facing a problem with ID auto-generator and class parameters / abstractions:
@Entity
class Task(@Required val label:String) extends Model{
@Id
val id: Long
}
object Task {
var find: Model.Finder[Long, Task] = new Model.Finder[Long, Task](classOf[Long], classOf[Task])
def all(): List[Task] = find.all.asScala.toList
def create(label: String) {
val task = new Task(label)
task.save
}
def delete(id: Long) {
find.ref(id).delete
}
}
Error: "The task of the class must be abstract, because the id value is not defined." Any idea to avoid this problem?
source
share