如果X.hbm.xml文件很多时,则写起来会很不方便,可以像下面这种写法就简单多了:(其中假设所有的.hbm.xml文件都存于com/model目录)
- <property name="mappingDirectoryLocations">
- <list>
- <value>classpath:/com/model</value>
- </list>
- </property>
本文介绍了一种简化Hibernate中XML映射文件配置的方法,通过设置mappingDirectoryLocations属性,指定所有.hbm.xml文件所在的目录,从而避免了大量重复的配置工作。
1640

被折叠的 条评论
为什么被折叠?



