报错信息:
org.hibernate.tool.schema.spi.CommandAcceptanceException: Error executing DDL "create table stu_classroom (sid integer not null, cid integer not null, primary key (cid, sid)) type=InnoDB" via JDBC Statement
错误原因:
由于使用的是MySQL5之后的版本,(hibernate.properties)这个文件给的方言中少个5,表格无法创建。
现将hibernate.cfg.xml配置改为最后一个
第一个数据库引擎创建的表格不支持外键,嗯,报错。