title: what is the purpose of two config files for Hibernate?
body: <p>This is my current project structure:</p>
  
  <pre><code>pom.xml
  /src
    /main
      /resources
        hibernate.cfg.xml
        /META-INF
          persistence.xml
  </code></pre>
  
  <p>I have very similar configuration params in both files (<code>hibernate.cfg.xml</code> and <code>persistence.xml</code>), which looks strange, but this is what I saw in many online examples and tutorials. I can't understand why do I need to have two files. Is it possible to work just with one? Please explain.</p>
  
  <p>ps. For example, should I declare <code>hibernate.dialect</code> in both files, or just one will be enough? If so, which one to use?</p>