|
From: Sam B. <sam...@sp...> - 2007-12-13 16:40:28
|
Hi Arnout, > The Hibernate *SessionFactoryBean contain a hibernate.cfg.Configuration, > and in some cases it can be useful to have access to that object from > the application. This isn't currently possible because the > AbstractSessionFactoryBean returns the SessionFactory with getObject(), > so the application only has access to the SessionFactory, not to the > *SessionFactoryBean itself. Are you familiar with using the "&beanName" technique for referencing a factory bean rather than the bean it creates? If not, have a look here at the Javadoc for LocalSessionFactoryBean.updateDatabaseSchema(): http://static.springframework.org/spring/docs/2.5.x/api/org/springframework/orm/hibernate3/LocalSessionFactoryBean.html#updateDatabaseSchema() You can use the same technique in your use case and then simply call getConfiguration() on the returned LocalSessionFactoryBean. Does that suit your needs? Regards, Sam -- Sam Brannen Senior Software Engineer SpringSource Limited (formerly Interface21) http://www.springsource.com Attend the Spring Experience, the premier conference for the Spring community December 12th - 15th, 2007 in Hollywood, Florida http://www.thespringexperience.com |