Fix model composition.

This commit is contained in:
shimamoto
2013-06-28 15:05:15 +09:00
parent c308e1993a
commit f170aa0a04
9 changed files with 54 additions and 47 deletions

View File

@@ -1,18 +1,16 @@
package model
import scala.slick.driver.H2Driver.simple._
import model.{BaseTable => Table}
object IssueComments extends Table[IssueComment]("ISSUE_COMMENT") with Functions {
def issueId = column[Int]("ISSUE_ID")
object IssueComments extends Table[IssueComment]("ISSUE_COMMENT") with IssueTemplate with Functions {
def commentId = column[Int]("COMMENT_ID", O AutoInc)
def commentedUserName = column[String]("COMMENTED_USER_NAME")
def content = column[String]("CONTENT")
def registeredDate = column[java.util.Date]("REGISTERED_DATE")
def updatedDate = column[java.util.Date]("UPDATED_DATE")
def * = base ~ issueId ~ commentId ~ commentedUserName ~ content ~ registeredDate ~ updatedDate <> (IssueComment, IssueComment.unapply _)
def * = userName ~ repositoryName ~ issueId ~ commentId ~ commentedUserName ~ content ~ registeredDate ~ updatedDate <> (IssueComment, IssueComment.unapply _)
def autoInc = base ~ issueId ~ commentedUserName ~ content ~ registeredDate ~ updatedDate returning commentId
def autoInc = userName ~ repositoryName ~ issueId ~ commentedUserName ~ content ~ registeredDate ~ updatedDate returning commentId
}
case class IssueComment(