Skip to content

Instantly share code, notes, and snippets.

@nc6
Created April 25, 2013 08:58
Show Gist options
  • Save nc6/5458452 to your computer and use it in GitHub Desktop.
Save nc6/5458452 to your computer and use it in GitHub Desktop.
Demonstration of the issue in playframework/play-slick#48. Results in an error: 'ReflectError: value ParameterTypes is not a package' during Slick DDL generation.
package models
package object dao {
val ParameterTypes = new ParameterTypes
}
package models.dao
import play.api.db.slick.Config.driver.simple._
/**
* A parameter to a role type.
*/
private[models] case class ParameterTypeDO(id: Long, name: String, description: Option[String])
private[models] class ParameterTypes extends Table[ParameterTypeDO]("PARAMETER_TYPES") with StandardQueries[ParameterTypeDO] {
def id = column[Long]("id", O.PrimaryKey, O.AutoInc)
def name = column[String]("name", O.NotNull)
def description = column[String]("description", O.Nullable)
def * = id ~ name ~ description.? <> (ParameterTypeDO.apply _, ParameterTypeDO.unapply _)
def forInsert = name ~ description.? returning id
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment