spring - hibernate load *.hbm.xml from classpath resource

后端 未结 5 641
野的像风
野的像风 2021-01-19 15:04

I have some hbm.xml files in classpath resource located in src/main/resources maven\'s folder. I used spring\'s LocalSessionFactoryBean to load these files with the followin

5条回答
  •  一个人的身影
    2021-01-19 15:22

    This looks quite okay to me. Hence I don't think the problem is the config. I rather think the files simply aren't on the classpath. How did you start your application?

    If you're using eclipse, make sure src/main/resources is used as source folder and resources are copied to target/classes.

提交回复
热议问题