hibernate创建表

hibernate自动注解创建表
1、编写实体类,
2、编写配置文件hibernate.cfg.xml:
    其中注意的地方有:<property name="hibernate.hbm2ddl.auto">create</property>
不要写成update
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
不要写成MySQLInnoDBDialect
3、编写测试类,

猜你喜欢

转载自1432429367.iteye.com/blog/2125252