Play Framework: add a custom Scalar Type in Ebean

Categories

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.

This website uses cookies. By continuing to browse the site you are agreeing to our privacy policy.By closing this banner or clicking on any other item of this page, you agree to the use of such cookies.