first attempt to ebean sql query generation