如何在 Scala 的 Web 框架 Lift 中导入 User 对象?
我正在关注 Lift 教程,它引用了 User< /代码> 对象。它没有说它来自哪里。我在 API 中也找不到它。有谁知道我必须导入什么才能获得它?
以下是模型中带有 FK 到 User
的示例代码:
object owner extends MappedLongForeignKey(this, User)
I'm following the Lift tutorial and it is referencing to a User
object. It doesn't say where it's coming from. I also could not find it in the API. Does anyone know what I have to import to get it?
Here's the sample code with a FK to User
in the model:
object owner extends MappedLongForeignKey(this, User)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
User 对象将成为源的一部分。假设您已经完成了 com.liftworkshop 项目,它将位于 todo/src/main/scala/com/liftworkshop/model/User.scala 中,并且可以从“com.liftworkshop.model.User”导入。
默认的 User 类和对象是根据 net.liftweb.mapper 中的 MetaProtoUser 和 MetaMegaProtoUser 特征构建的。
The User object will be part of your source. Assuming that you've done the com.liftworkshop project, it will be in todo/src/main/scala/com/liftworkshop/model/User.scala and can be imported from "com.liftworkshop.model.User".
The default User class and object are built from the MetaProtoUser and MetaMegaProtoUser traits in net.liftweb.mapper.