title: A simple search in Play Framework 2.1?
body: <p>I am having a hell of a time figuring this out. I want to make a basic search engine in my Play-Framework 2.1 Java app. The app has a list of video game records stored in a MySQL database. The UI lets you type in a video game title and search for it. The Play app should return a list of all games that match the query that the user entered. If the user searches for "Mario", it should return a list of all games that contain that text.</p>
  
  <p>Currently what I have in my Controller is:</p>
  
  <pre><code>public class Games extends controller {
      //NOTE: instance fields omitted
  
      public static Result search() {
          DynamicForm form = form().bindFromRequest();
          //Query is now stored in form.get("q"), though I can't figure out how to use it
  
          List&lt;Game&gt; games = new Model.Finder(String.class, Game.class).all();
          //This returns every game currently in the database
          return ok(search.render(games);
      }    
  }
  </code></pre>
  
  <p>I looked all throughout the <a href="http://www.playframework.com/documentation/api/2.0.3/java/play/db/ebean/Model.Finder.html#fetch%28java.lang.String%29" rel="nofollow">Play 2.0.3 documentation</a> (NOTE: I could not find documentation for 2.1 that covers this, which is the version I'm using) for the Model.Finder class and could not find out how to search custom queries, or how to build a SQL query that I want. I am quite lost and intermediate at Java. HELP! :-(</p>