Created
April 25, 2013 08:58
-
-
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.
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 | |
package object dao { | |
val ParameterTypes = new ParameterTypes | |
} |
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.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