title: How do I create a persistence.xml file for JPA and Hibernate?
body: <p>I'm trying to use Hibernate JPA but I need to create my persistence.xml (so I can use the entity manager correctly). I am unsure of what to create and where to place it.</p>
  <p>This is how my hibernate.cfg.xml in 'Core' mode configured.
  I'm using Eclipse Java EE IDE Web Developers (Indigo Release):</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;!DOCTYPE hibernate-configuration PUBLIC
          &quot;-//Hibernate/Hibernate Configuration DTD 3.0//EN&quot;
          &quot;http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd&quot;&gt;
  &lt;hibernate-configuration&gt;
      &lt;session-factory&gt;
          &lt;property name=&quot;hibernate.connection.driver_class&quot;&gt;com.mysql.jdbc.Driver&lt;/property&gt;
          &lt;property name=&quot;hibernate.connection.password&quot;&gt;XXXXXX&lt;/property&gt;
          &lt;property name=&quot;hibernate.connection.url&quot;&gt;jdbc:mysql://&lt;hostname&gt;/&lt;database&gt;&lt;/property&gt;
          &lt;property name=&quot;hibernate.connection.username&quot;&gt;XXXXX&lt;/property&gt;
          &lt;property name=&quot;hibernate.default_schema&quot;&gt;XXXXXX&lt;/property&gt;
          &lt;property name=&quot;hibernate.dialect&quot;&gt;org.hibernate.dialect.MySQLDialect&lt;/property&gt;
      &lt;/session-factory&gt;
  &lt;/hibernate-configuration&gt;
  </code></pre>