Skip to content

Instantly share code, notes, and snippets.

@Jacoby6000
Created June 8, 2015 19:01
Show Gist options
  • Select an option

  • Save Jacoby6000/0634e06cac1fb9cfdd83 to your computer and use it in GitHub Desktop.

Select an option

Save Jacoby6000/0634e06cac1fb9cfdd83 to your computer and use it in GitHub Desktop.
case class Supplier(id: Int, name: String, street: String, city: String, state: String, zip: String)
object ExampleDatastore extends H2Datastore(mode = H2Memory("example"), columnNameAdapter = SnakeUpperCaseAdapter) {
object suppliers extends Table("SUPPLIERS", classOf[Supplier])
}
case class Supplier(id: Int, name: String, street: String, city: String, state: String, zip: String)
object ExampleDatastore extends H2Datastore(mode = H2Memory("example"), columnNameAdapter = SnakeUpperCaseAdapter) {
object suppliers extends Table("SUPPLIERS") {
val id = column[Int]("ID", PrimaryKey)
val name = column[String]("NAME")
val street = column[String]("STREET")
val city = column[String]("CITY")
val state = column[String]("STATE")
val zip = column[String]("ZIP")
}
}
case class Supplier(id: Int, name: String, street: String, city: String, state: String, zip: String)
object ExampleDatastore extends H2Datastore(mode = H2Memory("example"), columnNameAdapter = SnakeUpperCaseAdapter) {
object suppliers extends Table("SUPPLIERS", classOf[Supplier]) {
val id = column[Int]("SUP_ID", PrimaryKey)
val name = column[String]("SUP_NAME")
}
}
case class Supplier(id: Int, name: String, street: String, city: String, state: String, zip: String)
object ExampleDatastore extends H2Datastore(mode = H2Memory("example"), columnNameAdapter = SnakeUpperCaseAdapter) {
object suppliers extends Table("SUPPLIERS", classOf[Supplier]) {
val id = column[Int]("SUP_ID", PrimaryKey)
val name = column[String]("SUP_NAME")
val street = column[String]("STREET")
val city = column[String]("CITY")
val state = column[String]("STATE")
val zip = column[String]("ZIP")
}
}
@Jacoby6000
Copy link
Copy Markdown
Author

Alternatively, add annotations to the case class fields for special column names

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment