07-08-2009 01:45 PM
Configuration config = new Configuration();
cfg = config
.configure(
"/org/alfresco/module/msc_core/activite/config/hibernate.cfg.xml" );<!– load hibernate configuration properties –>
<bean id="hibernateConfigProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="locations">
<list>
<value>classpath:alfresco/domain/hibernate-cfg.properties</value>
</list>
</property>
</bean>07-09-2009 10:21 AM
private static void init() throws Exception {
applicationContext = ApplicationContextHelper.getApplicationContext();
hibernateSessionHelper = (HibernateSessionHelper) applicationContext
.getBean( "hibernateSessionHelper" );
lSessionFactoryImplementor = (SessionFactoryImplementor) hibernateSessionHelper
.getSessionFactory();
ds = (DataSource) applicationContext.getBean( "dataSource" );
LocalSessionFactoryBean localSessionFactoryBean = (LocalSessionFactoryBean) applicationContext
.getBean( "&sessionFactory" );
cfg = new Configuration();
cfg
.addResource( "org/alfresco/module/msc_core/activite/config/Activite.hbm.xml" );
cfg.setProperties( localSessionFactoryBean.getHibernateProperties() );
}Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.