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>
  • 相关阅读:
    linux下activemq安装与配置
    Linux设置开放一个端口
    使用codis-admin搭建codis集群
    elasticsearch7.0安装及配置优化
    ELK详细安装部署
    filebeat安装部署
    ElasticSearch-5.3.1集群环境搭建,安装ElasticSearch-head插件,安装错误解决
    手把手教你搭建一个 Elasticsearch 集群
    ES 集群管理(集群规划、集群搭建、集群管理)
    Elasticsearch如何关掉服务
  • 原文地址:https://www.cnblogs.com/rigid/p/3954206.html
Copyright © 2011-2022 走看看