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>
  • 相关阅读:
    ZOJ3213-Beautiful Meadow
    ZOJ3256-Tour in the Castle
    ZOJ3466-The Hive II
    hdu3377-Plan
    fzu1977-Pandora Adventure
    ural1519-Formula 1
    poj2914-Minimum Cut
    51nod-1220-约数之和
    51nod-1222-最小公倍数计数
    【html】【6】div浮动float
  • 原文地址:https://www.cnblogs.com/rigid/p/3954206.html
Copyright © 2011-2022 走看看