创建EntityManagerFactory时,可以传递一组属性,这些属性将覆盖persistence.xml中定义的属性,例如:
Properties props = new Properties();props.setProperty("javax.persistence.jdbc.url", "test_url");_emf = Persistence.createEntityManagerFactory("dev", props);如果要在创建EntityManagerFactory之后修改连接属性,则必须通过
createEntityManagerFactory()再次调用来重新创建它。



