anchor.diff:  
   If we want to find the `User` with help of the Criteria API it becomes this piece of code:
   
  -{% highlight java %}
  +[source, java]
  +----
   try {
       CriteriaBuilder cb = JPA.em().getCriteriaBuilder();
       CriteriaQuery&lt;User&gt; query = cb.createQuery(User.class);
  
positive.code: 
  A way to generate our metamodels is by using the `org.hibernate.jpamodelgen.JPAMetaModelEntityProcessor`. The processor will automatically run if the hibernate-jpamodelgen.jar is added to the classpath and when you are using JDK 6. So we add a project dependecy to our Build.scala:
  
  {% highlight scala %}
  val appDependencies = Seq(
      "org.hibernate" % "hibernate-jpamodelgen" % "1.2.0.Final"
  )
  {% endhighlight %}
  
  And specify a folder where the generated source files are placed. This is done by passing an argument to the Java compiler. Passing an argument is also done in Build.scala:
  
  {% highlight scala %}
  val main = PlayProject(appName, appVersion, appDependencies, mainLang = JAVA).settings(
      javacOptions ++= Seq("-s", "metamodel")
  )
  {% endhighlight %}
  
  Note that the provided folder must exist, the Java compiler won’t generate it for you. So it is probably not a good idea to put the metamodels in our target folder, because its contents are deleted when the the `play clean` command is run.
  
  
negative.code: } catch (NonUniqueResultException nure) {
      return null;
  }
  ----
  
  This query won’t compile because the `like` method needs a `Expression&lt;String&gt;` as first parameter and `id` is a `Expression&lt;Long&gt;`.
  
  