spring整合hibernate扫描多个不同包下的实体类

来源:互联网 发布:pony 知乎 编辑:程序博客网 时间:2024/06/06 12:36

spring整合hibernate时,只需要扫描一个包下的问件时:

<span style="white-space:pre"></span><!-- 映射文件的位置  --><property name="mappingDirectoryLocations" value="classpath:entity"></property>

需要扫描不同包下的文件时:

<!-- 映射文件的位置  --><property name="mappingDirectoryLocations"><list><value>classpath:entity</value><value>classpath:com.kingdee.cloud.task.entity</value></list></property>


0 0
原创粉丝点击