• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

hibernate configuration in spring-dispatcher servlet

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

Am integrating Spring with Hibernate. Am using hibernate-cfg.xml for mappings and etc.. Can we write all the details of hibernate-cfg file in spring-config.xml with out seperate hibernate-cfg.xml ?
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

indu iyengar wrote:Hi all

Am integrating Spring with Hibernate. Am using hibernate-cfg.xml for mappings and etc.. Can we write all the details of hibernate-cfg file in spring-config.xml with out seperate hibernate-cfg.xml ?



Yes configure a bean where the class is LocalSessionFactoryBean or one of its subclasses like AnnotationSessionFactoryBean, now you can set hibernateProperties property to include the property settings, set the mappingLocation property to map to the hbm.xml files and packagesToScan for scanning for @Entity

All the details are in the SpringSource documentation on www.springframework.org

Mark
 
indu iyengar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks Mark
reply
    Bookmark Topic Watch Topic
  • New Topic