Skip to content

Instantly share code, notes, and snippets.

@fbettag
Created October 15, 2011 13:09
Show Gist options
  • Save fbettag/1289536 to your computer and use it in GitHub Desktop.
Save fbettag/1289536 to your computer and use it in GitHub Desktop.
Mapper Field-Classes to utilize PostgreSQL's CIDR and MAC Type
abstract class MappedCIDR[A <: Mapper[A]](override val fieldOwner: A) extends MappedString[A](fieldOwner, 132) {
override val maxLen = 132
override def fieldCreatorString(dbType: DriverType, colName: String): String = colName+" cidr"
}
abstract class MappedMAC[A <: Mapper[A]](override val fieldOwner: A) extends MappedString[A](fieldOwner, 18) {
override val maxLen = 18
override def fieldCreatorString(dbType: DriverType, colName: String): String = colName+" macaddr"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment