开发者

Play Scala Anorm "Magic[Country]().using("Countries")"

开发者 https://www.devze.com 2023-04-09 23:39 出处:网络
In looking at the docs for Play Scala Anorm, they show specifying a alternate table name as using thi开发者_Python百科s syntax:

In looking at the docs for Play Scala Anorm, they show specifying a alternate table name as using thi开发者_Python百科s syntax:

object Country extends Magic[Country]().using("Countries")

When i try to use this i get:

Error raised is : ';' expected but '.' found.

What is the correct Scala syntax for this to work?


Well there is an error in the example. You can do

val Country = new Magic[Country]().using("Countries")

but you certainly cannot do that with an object declaration You can use another constructor of Magic

object Country extends Magic[Country](Some("Countries"))

(see object User extends Magic[User]().using("users") can not compiled)

0

精彩评论

暂无评论...
验证码 换一张
取 消