老师为什么我按照你的方法运行Test时,MySQL里没有生成学生表和用户表啊?
运行Test测试方法时是这样子
运行Test测试方法时是这样子
2015-09-14
3.是正确的<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:mysql://localhost:3306/test</property>
<property name="hibernate.connection.username">root</property>
<property name="hibernate.connection.password"></property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQL5Dialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="hibernate.show_sql" >true</property>
<property name="hibernate.current_session_context_class">thread</property>
<mapping resource="entity/Students.hbm.xml"/>
<mapping resource="entity/Users.hbm.xml"/>
</session-factory>
</hibernate-configuration>
举报