報錯信息:
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配置改為最后一個
第一個數據庫引擎創建的表格不支持外鍵,嗯,報錯。