平时写mapping的文件需要一个一个的放到配置文件里,比如
1.
<
property
name
="mappingResources"
>
2. < list >
3. < value >model/Classes.hbm.xml </ value >
4. < value >model/Parent.hbm.xml </ value >
5. < value >model/Child.hbm.xml </ value >
6. < value >model/User.hbm.xml </ value >
7. </ list >
8. </ property >
2. < list >
3. < value >model/Classes.hbm.xml </ value >
4. < value >model/Parent.hbm.xml </ value >
5. < value >model/Child.hbm.xml </ value >
6. < value >model/User.hbm.xml </ value >
7. </ list >
8. </ property >
可以用更一步到位的方法:
1.
<
property
name
="mappingLocations"
>
2. < list >
3. < value >classpath*:/model/hbm </ value >
4. </ list >
5. </ property >
2. < list >
3. < value >classpath*:/model/hbm </ value >
4. </ list >
5. </ property >
注意:具体是否有用,本人还未试过,只是突然想到这个问题,先记录下!