Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Find all groups with the count of their posts.
- *
- * @return List[GroupLink]
- */
- def findGroupLinks() = {
- DB withSession { implicit session =>
- val q = (for {
- groups <- slickGroups
- posts <- slickPosts if groups.id === posts.groupId
- } yield (groups.title, posts)).groupBy(_._1.title)
- q.map {
- case (groupTitle, groupPosts) => GroupLink(groupTitle, groupPosts.length)
- }.list
- }
- }
- [error] /Users/arturgajewski/workspace/scala/cobase-pro/app/models/daos/GroupDAO.scala:41: type mismatch;
- [error] found : scala.slick.lifted.Column[String]
- [error] required: String
- [error] case (groupTitle, groupPosts) => GroupLink(groupTitle, groupPosts.length)
- [error] ^
- [error] /Users/arturgajewski/workspace/scala/cobase-pro/app/models/daos/GroupDAO.scala:41: type mismatch;
- [error] found : scala.slick.lifted.Column[Int]
- [error] required: Int
- [error] case (groupTitle, groupPosts) => GroupLink(groupTitle, groupPosts.length)
- [error] ^
- [error] /Users/arturgajewski/workspace/scala/cobase-pro/app/models/services/GroupService.scala:23: type mismatch;
- [error] found : List[Unit]
- [error] required: List[models.GroupLink]
- [error] def findGroupLinks(): List[GroupLink] = groupDAO.findGroupLinks()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement