I am writing a Java web application using Play Framework 2.1.0. And I use Ebean to manage the database. But I had one problem:
I have a model class called book with an int type column called a page:
public int page; @Column(name="page") public int getPage() { return page; } public void setPage(int page) { this.page = page; }
And the page column in my MySql database is also an int type. When I get the result (row) using Ebean, and the value of the page column in my database has the specified value, like 12, it works fine. But if the value of the page attribute is null in my database, the application throws an exception:
Execution exception[[PersistenceException: Error loading on models.Book.page]]
I can not handle this problem.
source share