Implementing Create NS
[so.git] / so-etsi-nfvo / so-etsi-nfvo-ns-lcm / so-etsi-nfvo-ns-lcm-database-service / src / main / java / org / onap / so / etsi / nfvo / ns / lcm / database / config / NfvoDatabaseConfiguration.java
index 0438a42..8f146e5 100644 (file)
@@ -48,11 +48,12 @@ import com.zaxxer.hikari.HikariDataSource;
         basePackages = {"org.onap.so.etsi.nfvo.ns.lcm.database.repository"})
 public class NfvoDatabaseConfiguration {
 
+    private static final String PERSISTENCE_UNIT = "nfvo";
+    private static final String NFVO_DATA_SOURCE_QUALIFIER = "nfvoDataSource";
+
     @Autowired(required = false)
     private MBeanExporter mBeanExporter;
 
-    private static final String NFVO_DATA_SOURCE_QUALIFIER = "nfvoDataSource";
-
     @Bean
     @ConfigurationProperties(prefix = "spring.datasource.hikari.nfvo")
     public HikariConfig nfvoDbConfig() {
@@ -72,8 +73,8 @@ public class NfvoDatabaseConfiguration {
     @Bean(name = "entityManagerFactory")
     public LocalContainerEntityManagerFactoryBean entityManagerFactory(final EntityManagerFactoryBuilder builder,
             @Qualifier(NFVO_DATA_SOURCE_QUALIFIER) final DataSource dataSource) {
-        return builder.dataSource(dataSource).packages(NfvoJob.class.getPackage().getName()).persistenceUnit("nfvo")
-                .build();
+        return builder.dataSource(dataSource).packages(NfvoJob.class.getPackage().getName())
+                .persistenceUnit(PERSISTENCE_UNIT).build();
     }
 
     @Primary