Spring boot and EntityManager based on application.properties
<p>I have following configuration file for Spring boot <code>application.properties</code>:</p>

<pre><code>spring.datasource.url=jdbc:postgresql://localhost:5432/postgres
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.datasource.driver-class-name=org.postgresql.Driver    
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
spring.jpa.show-sql = true  
spring.jpa.generate-ddl=true 
spring.jpa.hibernate.ddl-auto = update 
spring.jpa.database=POSTGRESQL   
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.ImprovedNamingStrategy
spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.PostgreSQL82Dialect
</code></pre>

<p>It perfectly handled by spring <code>ddl-auto</code> creates tables for me. I expect it's enough information to create <code>EntityManager</code> from this 'DataSource'. </p>

<p>I found out that one of the ways to create <code>EntityManager</code> is:</p>

<pre><code>EntityManagerFactory emfactory = Persistence.createEntityManagerFactory( "DataSorceGoesHere" );    
EntityManager entitymanager = emfactory.createEntityManager( );
</code></pre>

<p><strong>The questions are:</strong> </p>

<ol>
<li>What is the name of my datasource configured in <code>application.properties</code>?</li>
<li>Is there any opportunities to inject <code>EntityManager</code> based on <code>application.properties</code>?</li>
</ol>