数据库
sc
CREATE TABLE `sc` (
`xh` varchar(10) NOT NULL DEFAULT '',
`kcdh` varchar(10) NOT NULL DEFAULT '',
`cj` smallint(6) DEFAULT NULL,
PRIMARY KEY (`xh`,`kcdh`) USING BTREE,
KEY `sc_ibfk_2` (`kcdh`),
CONSTRAINT `sc_ibfk_1` FOREIGN KEY (`xh`) REFERENCES `student` (`xh`),
CONSTRAINT `sc_ibfk_2` FOREIGN KEY (`kcdh`) REFERENCES `course` (`kcdh`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
其他的和下面pojo差不多。
pojo
student
@Data
@TableName("student")
public class Student {
@TableId
String xh;
// List<Sc> scs;
}
Course
@Data
@TableName("course")
public class Course {
&#