摘要: 在Spring 集成 Hibernate 的JPA方式中,需要在persistence配置文件中定义每一个实体类,这样非常地不方便,远哥目前找到了2种方法。这2种方式都可以实现不用persistence.xml文件,免去每个Entity都要在persistence.xml文件中配置的烦恼,但是这种方式Entity实体类的主键字段注解@ID要放到 getXXX()方法上,否则不认。方式1:修改“LocalContainerEntityManagerFactoryBean”的配置,如下: ${jdbc.driverClassName} ${jdbc.url}... 阅读全文
posted @ 2013-10-04 19:59 远哥 阅读(27496) 评论(4) 推荐(1) 编辑