• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

hibernate configuration in spring-dispatcher servlet

 
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • 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: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
thanks Mark
 
moose poop looks like football shaped elk poop. About the size of this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic