Skip to content
Snippets Groups Projects
UUIDSqlResultHandler.scala 359 B
Newer Older
  • Learn to ignore specific revisions
  • package de.tobias.playpad.server.sql
    
    
    import java.util.UUID
    
    
    class UUIDSqlResultHandler extends SqlResultHandler {
    
    Tobias Ullerich's avatar
    Tobias Ullerich committed
    	override def fromResult(o: Any): Any = {
    		o match {
    			case string: String => UUID.fromString(string)
    			case _ => null
    		}
    	}
    
    Tobias Ullerich's avatar
    Tobias Ullerich committed
    	override def toQuery(o: Any): Any = {
    		o match {
    			case uuid: UUID => uuid.toString
    			case _ => null
    		}
    	}