title: Simple CRUD tutorial about Play Framework and MySQL using Ebean?
body: <p>I am new to Play Framework. I have started learning it and so far I am enjoying it. 
  I have started to learn Play Java.</p>
  
  <p>I have my controller and model set up as follow: </p>
  
  <p><strong>Controller:</strong> </p>
  
  <pre><code>package controllers;
  
  import play.mvc.Controller;
  import play.mvc.Result;
  
  //Import Product model
  import models.Product;
  
  public class Products extends Controller{
  
  
      /**
       * List all Products
       */
      public static Result list(){
          Object allProducts = Product.findAll();
          return ok((Content) allProducts); //return all products
      }
  }
  </code></pre>
  
  <p><strong>Model:</strong> </p>
  
  <pre><code>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(){
          //Using ebean and MySql, fech the product table
          //and return all products
      }
  }
  </code></pre>
  
  <p>To enable the use of MySql, I have already edited the /conf/application.conf as follow: </p>
  
  <pre><code>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.*"
  </code></pre>
  
  <p>I have a play_db database with one table shown as follow: </p>
  
  <p><img src="https://i.stack.imgur.com/41Z4F.png" alt="enter image description here"></p>
  
  <p>My problem is how to fetch all the products in the Product model using ebean and MySQL. 
  Can someone please point me to a simple crud tutorial which uses play java in combination with ebean and MySql? Thanks</p>
  
  <p>Anyone?</p>
  
  <p><strong>NOTE</strong>
  By the way, I am using Play v.2.3.5 for Java</p>