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

后端 未结 5 558
野的像风
野的像风 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:41

    Files located in src/main/resources end up in WEB-INF/classes when using Maven with a project of type war (and the resources directory structure is preserved). So either place your mapping files in src/main/resources/mapping or use the following configuration:

    
            
            
                    
                            SystemUser.hbm.xml
                            SystemCredential.hbm.xml
                            SystemProvince.hbm.xml
                    
            
            
            
                    hibernate.dialect=org.hibernate.dialect.Oracle10gDialect
            
        
    
    

提交回复
热议问题