How to implement JPA in Play Framework in a standard way
<p>I have gone though <a href="https://www.playframework.com/documentation/2.5.x/JavaJPA" rel="nofollow">https://www.playframework.com/documentation/2.5.x/JavaJPA</a></p>

<p>But it doesn't feel like a stardard way. I would like fill my jdbc connection in <code>persistence.xml</code> instead of application.conf</p>

<p>like this</p>

<pre><code>    &lt;?xml version="1.0" encoding="UTF-8" ?&gt;
    &lt;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_2_0.xsd"
    version="2.0" xmlns="http://java.sun.com/xml/ns/persistence"&gt;
    &lt;persistence-unit name="TestPersistence"
    transaction-type="RESOURCE_LOCAL"&gt;
    &lt;class&gt;com.example.pojo.Employee&lt;/class&gt;
 &lt;provider&gt;org.eclipse.persistence.jpa.PersistenceProvider&lt;/provider&gt;
 &lt;non-jta-data-source&gt;DefaultDS&lt;/non-jta-data-source&gt;
    &lt;properties&gt;
    &lt;property name="javax.persistence.jdbc.driver" value="com.mysql.jdbc.Driver" /&gt;
    &lt;property name="javax.persistence.jdbc.url"
    value="jdbc:mysql://localhost:3306/jpadb" /&gt;
    &lt;property name="javax.persistence.jdbc.user" value="root" /&gt;
    &lt;property name="javax.persistence.jdbc.password"
    value="mukesh" /&gt;
    &lt;!-- EclipseLink should create the database schema automatically --&gt;
    &lt;property name="eclipselink.ddl-generation" value="create-tables" /&gt;
    &lt;property name="eclipselink.ddl-generation.output-mode"
    value="database" /&gt;
    &lt;/properties&gt;
    &lt;/persistence-unit&gt;
    &lt;/persistence&gt;
</code></pre>

<p>instead of filling the jdbc connection in application.conf like</p>

<pre><code>db.default.driver=com.mysql.jdbc.Driver
db.default.url="jdbc:mysql://localhost:3306/jpadb"
db.default.user=root
db.default.password="mukesh"
db.default.jndiName=DefaultDS
jpa.default=TestPersistence
</code></pre>

<p>Also if there is no other way to get jdbc connection in persistence.xml how can we define more than one jdbc connection in application.conf. like if i have a mysql for users and oracle db for posts.</p>

<p>NOTE: the source code posted are just dummy copied from public domain to show the briefly problem.</p>