How do you translate Hibernate class mappings to a Spring application context?

前端 未结 3 682
滥情空心
滥情空心 2021-02-02 03:12

How do you configure the Hibernate class mappings of class org.springframework.orm.hibernate3.LocalSessionFactoryBean in the Spring application context? I want to move the sess

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-02-02 03:27

    As a slight variation on skaffman's answer, I used property packagesToScan of class AnnotationSessionFactoryBean to avoid listing all of the individual model class names:

    
        
        
           
               com.company.app.common.model
           
        
        
           
              Queries.hbm.xml
           
                
        
            
                org.hibernate.dialect.Oracle10gDialect
            
        
    
    

    I learned about this property from the excellent book Spring in Action, Third Edition.

提交回复
热议问题