diff options
Diffstat (limited to 'src/main/scala')
-rw-r--r-- | src/main/scala/xyz/driver/core/database.scala | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/main/scala/xyz/driver/core/database.scala b/src/main/scala/xyz/driver/core/database.scala index d948be7..cf19c34 100644 --- a/src/main/scala/xyz/driver/core/database.scala +++ b/src/main/scala/xyz/driver/core/database.scala @@ -33,8 +33,9 @@ object database { } trait ColumnTypes { - val profile: JdbcProfile + import java.util.UUID + val profile: JdbcProfile import profile.api._ implicit def `xyz.driver.core.Id.columnType`[T] = @@ -45,6 +46,9 @@ object database { implicit def `xyz.driver.core.time.Time.columnType` = MappedColumnType.base[Time, Long](_.millis, Time(_)) + + implicit def `java.util.UUID.columnType`[T] = + MappedColumnType.base[Id[T], UUID](id => UUID.fromString(id.value), uuid => Id[T](uuid.toString)) } trait DatabaseObject extends ColumnTypes { |