zoukankan      html  css  js  c++  java
  • hibernate多SessionFactory配置

    <bean id="aDataSource" class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
        <property name="driverClassName">
            <value>${adriver}</value>
        </property>
        <property name="url">
            <value>${aurl}</value>
        </property>
        <property name="username">
            <value>${ausername}</value>
        </property>
        <property name="password">
            <value>${apassword}</value>
        </property>
    </bean>
    <bean id="bDataSource" class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
        <property name="driverClassName">
            <value>${bdriver}</value>
        </property>
        <property name="url">
            <value>${burl}</value>
        </property>
        <property name="username">
            <value>${busername}</value>
        </property>
        <property name="password">
            <value>${bpassword}</value>
        </property>
    </bean>
    
    <!-- Hibernate SessionFactorys -->
    <bean id="aSessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref local="aDataSource" />
        </property>
        <property name="mappingResources">
            <list>
                <value>.hbm.xml文件</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${ahibernate.dialect}</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="format_sql">true</prop>
            </props>
        </property>
    </bean>
    
    <bean id="bSessionFactory"
        class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource">
            <ref local="bDataSource" />
        </property>
        <property name="mappingResources">
            <list>
                <value>.hbm.xml文件</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">${bhibernate.dialect}</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="format_sql">true</prop>
            </props>
        </property>
    </bean>
  • 相关阅读:
    梯度下降的矩阵分解公式推导
    再谈矩阵分解在推荐系统中的应用
    浅谈矩阵分解在推荐系统中的应用
    tomcat局域网内发布html
    通过JavaScript动态生成html控件
    html 复选框checkbox
    HTML <frameset>不同frame之间传值
    OpenLayers 案例一
    ubuntu java开发环境jdk安装
    如何成为Python高手
  • 原文地址:https://www.cnblogs.com/rigid/p/3954206.html
Copyright © 2011-2022 走看看