1 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
2 <property name="dataSource" ref="dataSource"></property>
3 <property name="hibernateProperties">
4 <props>
5 <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
6 <prop key="hibernate.show_sql">true</prop>
7 </props>
8 </property>
9 <property name="annotatedClasses">
10 <list>
11 <value>com.donghang.bean.User</value>
12 </list>
13 </property>
14 </bean>
其中User即為采用Anotation映射的實體類。2 <property name="dataSource" ref="dataSource"></property>
3 <property name="hibernateProperties">
4 <props>
5 <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
6 <prop key="hibernate.show_sql">true</prop>
7 </props>
8 </property>
9 <property name="annotatedClasses">
10 <list>
11 <value>com.donghang.bean.User</value>
12 </list>
13 </property>
14 </bean>