首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 软件管理 > 软件架构设计 >

Hibernate-@Annotation-一对多-级联

2012-10-17 
Hibernate----@Annotation----一对多----级联一对多,双向,一的一方??单元测试类??xml version1.0 en

Hibernate----@Annotation----一对多----级联

一对多,双向,"一"的一方

?

?单元测试类

?

<?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>                 <property name="connection.driver_class">com.mysql.jdbc.Driver</property>        <property name="connection.url">jdbc:mysql://localhost/hibtest</property>        <property name="connection.username">root</property>        <property name="connection.password">123</property>        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>               <!-- JDBC connection pool (use the built-in) -->        <property name="connection.pool_size">1</property>        <!-- Enable Hibernate's automatic session context management -->        <property name="current_session_context_class">thread</property>        <!-- Disable the second-level cache  -->        <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>        <!-- Echo all executed SQL to stdout -->        <property name="show_sql">true</property>        <!-- <property name="format_sql">true</property> -->        <!-- Drop and re-create the database schema on startup        <property name="hbm2ddl.auto">update</property> -->        <!--          <mapping resource="com/pegasus/domain/Group.hbm.xml"/> <mapping resource="com/pegasus/domain/User.hbm.xml"/> --> <mapping class="com.pegasus.domain.Group"/><mapping class="com.pegasus.domain.User"/>    </session-factory></hibernate-configuration>

热点排行