Persistence创建EntityManagerFactory
其中,属性 hibernate.show_sql的值为true,若创建EntityManagerFactory对象时采用以下的代码,则实际获得的 EntityManagerFactory对象属性hibernate.show_sql则为false,即为代码中所设置的将覆盖配置文件中所配置的,如下所示。
Map properties = new HashMap();
properties.put("hibernate.show_sql", "false");
EntityManagerFactory emf = Persistence.createEntityManagerFactory("jpaUnit", properties);