配置通过静态工厂方法创建的bean public class StaticBookFactory { //静态工厂方法: public static Book getBook(String bookName){ System.out.println("静态工厂方法调用..."); Book book = new Book(); book.setBookName(bookName+"_static"); book.setAuthor(new Person()); bo…
spring生成EntityManagerFactory的三种方式 1.LocalEntityManagerFactoryBean只是简单环境中使用.它使用JPA PersistenceProvider自动检测机制( according to JPA's Java SE bootstrapping ),并且大多数情况下,你只能定义一下persistence unit name 例如: <beans><bean id="myEmf" class="org.sp…