I am new to Play Framework. I started to study it, and still I like it. I started learning Play Java.
I have my controller and model installed as follows:
Controller:
package controllers; import play.mvc.Controller; import play.mvc.Result;
Model:
package models; import java.util.List; import play.db.*; import play.api.db.DB; import com.avaje.ebean.Ebean; import com.avaje.ebean.Query; public class Product { public int id; public String name; public String description; public Product(){ } public Product(int id, String name, String description){ this.id = id; this.name = name; this.description = description; } public static String findAll(){
To enable the use of MySql, I already edited the /conf/application.conf file as follows:
db.default.driver=com.mysql.jdbc.Driver db.default.url="jdbc:mysql://localhost/play_db?characterEncoding=UTF-8" db.default.user=user db.default.password=pass ebean.default="models.*"
I have a play_db database with one table shown below:

My problem is how to get all the products in the product model using ebean and MySQL. Can someone please point me to a simple crud tutorial that uses java games in conjunction with ebean and MySql? Thanks
Is anyone
Note By the way, I am using Play v.2.3.5 for Java
Lomse
source share