Return to Snippet

Revision: 5570
at March 17, 2008 11:49 by narkisr


Initial Code
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"
          lazy-init="true" parent="classesListContainer">
        <property name="dataSource">
            <ref bean="dataSource"/>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.SybaseDialect</prop>
                <!--<prop key="hibernate.show_sql">true</prop>-->
                <!--<prop key="hibernate.format_sql">true</prop>-->
                <!--<prop key="hibernate.hbm2ddl.auto">validate</prop>-->
            </props>
        </property>
        <property name="annotatedClasses">
            <list>
                <value>com.dummy.DummyClass</value>
                <!-- list of all the annotated classes -->                 
            </list>
        </property>
</bean>

<!-- A template which works with hbm -->
<bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate" lazy-init="true">
        <property name="sessionFactory" ref="sessionFactory"/>
</bean>

Initial URL
HibernateAndSpringConfiguration

Initial Description
This spring context configures a simple hibernate session (for annotated classes).

Initial Title
Spring and Hibernate simple configuration

Initial Tags
java

Initial Language
Java