简体   繁体   English

Lightbend示例语法错误

[英]Lightbend examples syntax error

I just wonder if I have messed something up or is it just unavoidable pain of using Scala. 我只是想知道我是否弄乱了某些东西,还是使用Scala不可避免的痛苦。 I wanted to test out slick so I decided to run activator-play-slick-angularjs example from Lightbend . 我想测试activator-play-slick-angularjs所以我决定从Lightbend运行activator-play-slick-angularjs示例。 Unfortunatelly I get syntax errors while using 不幸的是我在使用时遇到语法错误

lazy protected val empTableQuery: TableQuery[EmployeeTable] = TableQuery[EmployeeTable]

in any possible way. 以任何可能的方式。 In filtering examples, the type I am required by Scala plugin to use is Any eg 在过滤示例中,Scala插件要求使用的类型是Any例如

def delete(id: Int): Future[Int] = db.run { empTableQuery.filter(_.id === id).delete }

_.id part yields syntax error. _.id部分产生语法错误。 I bet that I am just missing something because I can't imagine a single developer willing to work in 2017 without syntax assistance from IDE. 我敢打赌,我只是想念一些东西,因为我无法想象有一个开发人员愿意在没有IDE语法帮助的情况下在2017年工作。

In case somebody met this problem in future - in this example EmployeeTable is defined with private[EmployeeTable] what makes in not visible in EmployeeRepository class. 如果将来有人遇到此问题-在此示例中, EmployeeTable是用private[EmployeeTable]定义的,这使得在EmployeeRepository类中不可见。 Just skip the private[EmployeeTable] part in class definition to make everything work smoothly. 只需跳过类定义中的private[EmployeeTable]部分,即可使所有工作顺利进行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM