Skip to content

Instantly share code, notes, and snippets.

@lamielle
Created August 26, 2012 17:52
Show Gist options
  • Save lamielle/3482069 to your computer and use it in GitHub Desktop.
Save lamielle/3482069 to your computer and use it in GitHub Desktop.
Using StringField as a workaround for Squeryl's current lack of UUIDField support
class UUIDTest private() extends Record[UUIDTest] with KeyedRecord[String] {
override def meta = UUIDTest
val idField = new StringField(this, 36) {
override val defaultValue = UUID.randomUUID.toString
}
}
object UUIDTest extends UUIDTest with MetaRecord[UUIDTest]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment