I'm currently porting a project from scala 2.9 to 2.10, therefore I have to use slick instead of scalaquery. I'm using slick 2.1.0 for now since it supports MS Access.
According to this tutorial and the upgrade guide I changed Robs
from object to class and added the val robs
:
Why do I get the error message Wrong top statement declaration
and how do I get rid of it?
EDIT: I'm new to scala... According to this question it seems like I can't put a val outside of methods or classes, right? The code above is directly in a packge. But what is the right approach for slick then? Should I move the code in some class or trait?
According to this I changed
val robs = TableQuery[Robs]
to
object robs extends TableQuery(new Robs(_)) {}
.
No warnings or errors anymore. :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With