Play Framework: add a custom Scalar Type in Ebean

Categorie

Unfortunately within the Ebean docs is not so clear how to redefine a scalar type. We made some experiments and it is quite simple though. In our example here we've created a new class to extend the classic java.util.Date.

You just have to create a new class that implements the conversion using the ScalarTypeConverter interface and put it into the models folder.