• 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
  • Liutauras Vilda
  • Bear Bibeault
  • Junilu Lacar
  • Martin Vashko
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Scott Selikoff
  • salvin francis
  • Piet Souris

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: 17344
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
 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!