日期:2014-05-20  浏览次数:20633 次

spring中的hibnate怎么配置 ?最好能说下原理
spring中的hibnate怎么配置 原理是什么 类从哪里得到
谢谢!!!

------解决方案--------------------
XML code

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource" ref="datasource"></property>
        <property name="configurationClass">
            <value>org.hibernate.cfg.AnnotationConfiguration</value>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${hibernate.dialect}</prop>
                <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>
                <prop key="hibernate.hbm2ddl.auto">${hibernate.hbm2ddl.auto}</prop>
            </props>
        </property>
        <property name="configLocations">
            <list>
                <value>classpath*:hibernate.cfg.xml</value>
            </list>
        </property>
    </bean>

------解决方案--------------------
http://blog.csdn.net/luohuijun619/article/details/5012957