Results 1 to 2 of 2

Thread: HIBERNATE: General Hiberbate.Cfg.XML file for a generic STRUTS 2 based project.

  1. #1
    Junior Member
    Join Date
    Jan 2014
    Posts
    27

    HIBERNATE: General Hiberbate.Cfg.XML file for a generic STRUTS 2 based project.

    Code:
    <?xml version='1.0' encoding='utf-8'?>
    <!DOCTYPE hibernate-configuration PUBLIC
            "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
            "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
    
    <hibernate-configuration>
    
        <session-factory>
    
            <!-- Database connection settings -->
            <!-- <property name="connection.driver_class">org.hsqldb.jdbcDriver</property>
                        <property name="connection.url">jdbc:hsqldb:hsql://localhost/TestDB</property> -->
    
            <property name="connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property>
            <property name="connection.url">jdbc:sqlserver://localhost:1433;user=sa;password=12</property>
            <!--<property name="connection.username">sa</property>
            <property name="connection.password"></property>-->
    
            <!-- JDBC connection pool (use the built-in) -->
            <property name="connection.pool_size">1</property>
    
            <!-- SQL dialect -->
            <property name="dialect">
                org.hibernate.dialect.SQLServer2012Dialect
            </property>
    
            <!-- Enable Hibernate's automatic session context management -->
            <property name="current_session_context_class">thread</property>
    
            <property name="cache.use_query_cache">true</property>
            <property name="cache.use_second_level_cache">true</property>
            <property name="cache.use_structured_entries">true</property>
            <property name="cache.region.factory_class">org.hibernate.cache.EhCacheRegionFactory</property>
            <property name="net.sf.ehcache.configurationResourceName">/hibernate-config/ehcache.xml</property>
            <property name="hibernate.hbm2ddl.auto">create</property> 
            <!-- Echo all executed SQL to stdout -->
            <property name="show_sql">true</property>
            <mapping resource="hibernate-config/domain/Event.hbm.xml"/>
            <mapping resource="hibernate-config/domain/Person.hbm.xml"/>
            <mapping resource="hibernate-config/domain/PhoneNumber.hbm.xml"/>
            <mapping resource="hibernate-config/domain/Account.hbm.xml"/>
            <mapping resource="hibernate-config/domain/HolidayCalendar.hbm.xml"/>
    
            <mapping resource="hibernate-config/domain/Item.hbm.xml"/>
            <mapping class="Action.Process"/>
        </session-factory>
    
    </hibernate-configuration>

  2. #2

    Re: HIBERNATE: General Hiberbate.Cfg.XML file for a generic STRUTS 2 based project.

    Cơ hội đầu tư BĐS hiệu quả với nhiều ch*nh sách ưu đãi:
    6th element
    Giá bán chỉ từ 34 triệu/m2 (VAT + full nội thất cao cấp)
    CĂN HỘ ĐẲNG CẤP – SỞ HỮU VỊ TRÍ VÀNG – KÝ HĐMB TRỰC TIẾP CĐT
    Golden Park Tower
    THỦ TỤC LINH HO*T – DỄ DÀNG – NHANH CHÓNG

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •