Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
trait XsnTypeMode extends PrimitiveTypeMode {
import com.codahale.jerkson.Json._
import scala.collection.mutable.HashMap
import scala.language.implicitConversions
implicit val jsonTEF = new NonPrimitiveJdbcMapper[String,HashMap[String, Any],TString](stringTEF, this) {
def convertFromJdbc(v: String) = if(v == null) null else parse[HashMap[String, Any]](v)
def convertToJdbc(v: HashMap[String, Any]) = if(v == null) null else generate(v)
override def sample = new HashMap[String, Any]()
implicit def mapToTE(s: HashMap[String, Any]) = jsonTEF.create(s)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment