Created
June 3, 2015 16:39
-
-
Save cameronhotchkies/117e7c7ae608b32f35e8 to your computer and use it in GitHub Desktop.
Common Joda DateTime Mapping
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
import play.api.db.slick.Config.driver.simple._ | |
import org.joda.time.DateTime | |
import java.sql.Timestamp | |
object SlickMapping { | |
implicit def jodaDateTimeMapping = | |
MappedColumnType.base[DateTime, Timestamp]( | |
dt => new Timestamp(dt.getMillis), | |
ts => new DateTime(ts.getTime)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment