Created
May 15, 2015 21:26
-
-
Save dhoss/dc6d5caada2e2281ab75 to your computer and use it in GitHub Desktop.
play 2.4 play-slick model example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package models | |
import org.joda.time.DateTime | |
case class Page[A](items: Seq[A], page: Long, offset: Long, total: Long) { | |
lazy val prev = Option(page - 1).filter(_ >= 0) | |
lazy val next = Option(page + 1).filter(_ => (offset + items.size) < total) | |
} | |
case class Person(id: Long, email: String, password: String, createdAt: Option[DateTime], updatedAt: Option[DateTime]) | |
case class ExerciseType(id: Long, name: String, description: String, createdAt: Option[DateTime], updatedAt: Option[DateTime]) | |
case class Exercise(id: Long, kind: Long, name: String, reps: Option[Long], weight: Option[Long], time: Option[Long], notes: Option[String], person: Long, createdAt: Option[DateTime], updatedAt: Option[DateTime]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment