Now we have all the dao
packages implemented with the respective database evolutions. However, our services expected a different contract, since we were using an in-memory database before. Let's refactor the product controller:
package controllers @Singleton class ProductController @Inject() (val messagesApi:MessagesApi,val service:IProductService) extends Controller with I18nSupport { val productForm: Form[Product] = Form( mapping( "id" -> optional(longNumber), "name" -> nonEmptyText, "details" -> text, "price" -> bigDecimal )(models.Product.apply)(models.Product.unapply) ) def index = Action { implicit request => val products = Awaits.get(5,service.findAll()) .getOrElse(Seq()) Logger.info("index called. Products: " + products) Ok(views.html.product_index(products)) } def blank = Action { implicit...