public class EntityManagerFactory {
public static EntityManager get() {
Map<String, Object> properties = new HashMap<>();
properties.put("javax.persistence.jdbc.url", Config.DATABASE_URL);
properties.put("javax.persistence.jdbc.driver", Config.DATABASE_DRIVER);
properties.put("javax.persistence.jdbc.user", Config.DATABASE_USER);
properties.put("javax.persistence.jdbc.password", Config.DATABASE_PWD);
properties.put(PersistenceUnitProperties.WEAVING, "static");
return new PersistenceProvider().createEntityManagerFactory("dbsource_pu", properties).createEntityManager();
}
}