Is it possible to cast a SqlQuery results from Ebean to a Model (Bean)?
问题 Using Ebean (via Play Framework 2.1.1), I have to build a home made SQL query, but I'd like it to return directly a List<MyModel> , instead of a List<SqlRow> that I would have to query the database for each id from the result to have a List<MyModel> . Is it possible to cast directly a SqlQuery/SqlRow to a Model ? Actually, I do that : SqlQuery query = Ebean.createSqlQuery("SELECT id FROM MyModel WHERE ..."); List<SqlRow> rows = query.findList(); // not directly possible. List<MyModel> results