Mybatis CRUD注解Annotation的使用
@Select,@Insert,@Update,@Delete完成常见的增删改查sql语句的映射。
注解和xml配置中的sql语法一致。
@Options注解,使用数据库自动增长的主键,需要底层数据库的支持。
测试类。
将数据表中的字段名和PO类中的属性进行匹配对应,就要使用@Result注解。
一对一关联查询@One注解的使用
OneToMany一对多关联查询
ManyToMany多对多关联查询
@Select,@Insert,@Update,@Delete完成常见的增删改查sql语句的映射。
注解和xml配置中的sql语法一致。
@Options注解,使用数据库自动增长的主键,需要底层数据库的支持。
测试类。
将数据表中的字段名和PO类中的属性进行匹配对应,就要使用@Result注解。
一对一关联查询@One注解的使用
OneToMany一对多关联查询
ManyToMany多对多关联查询