读书人

srping 3.1 治理hibernate 持久化对象

发布时间: 2012-09-23 10:28:11 作者: rapoo

srping 3.1 管理hibernate 持久化对象的配置
1:注解的方式

<bean id="sessionFactory" /></property><property name="hibernateProperties"><props><prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop><prop key="hibernate.show_sql">true</prop><prop key="hibernate.connection.proxool_provider_class">org.hibernate.connection.ProxoolConnectionProvider</prop><prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop><prop key="hibernate.show_sql">true</prop><prop key="hibernate.format_sql">false</prop><prop key="hibernate.use_sql_comments">true</prop><prop key="hibernate.connection.autocommit">true</prop>      <prop key="hibernate.cglib.use_reflection_optimizer">true</prop><prop key="hibernate.bytecode.use_reflection_optimizer">true</prop></props></property>

2:xml 文式
<!-- 配置Hibernate的sessionFactory --><bean id="sessionFactory" /></property><property name="hibernateProperties"><props><prop key="hibernate.dialect">org.hibernate.dialect.OracleDialect</prop><prop key="hibernate.show_sql">true</prop></props></property><property name="configLocation">            <value>classpath:conf/hibernate.cfg.xml</value>        </property>==========================hibernate.cfg.xml<hibernate-configuration><session-factory><mapping resource="personal/learn/entity/Manager.hbm.xml" /></session-factory></hibernate-configuration>

读书人网 >软件架构设计

热点推荐