title: Do I need <class> elements in persistence.xml?
body: <p>I have very simple persistance.xml file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;persistence version="1.0"
      xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;
  
      &lt;persistence-unit name="eventractor" transaction-type="RESOURCE_LOCAL"&gt;
          &lt;class&gt;pl.michalmech.eventractor.domain.User&lt;/class&gt;
          &lt;class&gt;pl.michalmech.eventractor.domain.Address&lt;/class&gt;
          &lt;class&gt;pl.michalmech.eventractor.domain.City&lt;/class&gt;
          &lt;class&gt;pl.michalmech.eventractor.domain.Country&lt;/class&gt;
  
          &lt;properties&gt;
              &lt;property name="hibernate.hbm2ddl.auto" value="validate" /&gt;
              &lt;property name="hibernate.show_sql" value="true" /&gt;
          &lt;/properties&gt;
      &lt;/persistence-unit&gt;
  
  &lt;/persistence&gt;
  </code></pre>
  
  <p>and it works.</p>
  
  <p>But when I remove <code>&lt;class&gt;</code> elements application doesn't see entities (all classes are annotated with <code>@Entity</code>).</p>
  
  <p>Is there any automatic mechanism to scan for <code>@Entity</code> classes?</p>