0

datasource.hibernate.cfg.xml has hiberanteProperties and all the mapping resources.
But right now I have to define mapping resources and properties in applicationContext.xml separately.
Can I just specify datasource.hibernate.cfg.xml as configLocation inside <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean"> and get rid of both mappingResources and hibernateProperties. Right now my application context looks like this:

<property name="mappingResources"/>
            <list>
                <value>../../src/editsolutions.hibernate.cfg.xml</value>
            </list>
        <property name="hibernateProperties"> 
           <props> 
           <prop key="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</prop> 
           <prop key="hibernate.connection.isolation">3</prop> 
           <prop key="hibernate.current_session_context_class">jta</prop> 
           <prop key="hibernate.transaction.factory_class"> 
               org.hibernate.transaction.JTATransactionFactory 
           </prop> 
           <prop key="hibernate.transaction.manager_lookup_class"> 
              com.atomikos.icatch.jta.hibernate.TransactionManagerLookup 
           </prop> 
           </props>
        </property> 

Note: I don't use annotations for entity classes. It's a legacy project and everything is defined via hbm.xml.

1 Answer 1

1

You can set 'configLocation' property and get rid of other properties. See

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.