网站关键词优化的价格,叮当快药网站谁做的,seo收录查询工具,做枪版电影网站赚钱Model
pojo 类继承 Model 抽象类#xff0c;即可获得 CRUD#xff08;增删改查#xff09;功能。Model 使用映射类 pojo 继承 Model 抽象类#xff0c;直接使用该类可以进行 CRUD#xff0c;但是必须存在对应的 xxMapper 继承 BaseMapper。
Mapper
Mapper 用于 service…Model
pojo 类继承 Model 抽象类即可获得 CRUD增删改查功能。Model 使用映射类 pojo 继承 Model 抽象类直接使用该类可以进行 CRUD但是必须存在对应的 xxMapper 继承 BaseMapper。
Mapper
Mapper 用于 service 层通过 xxMapper 调用从 Mapper 继承的方法。 BaseMapper 实现了 Mapper 接口。 xxMapper 类继承 BaseMapper 接口后无需编写 mapper.xml 文件即可获得 CRUD增删改查功能。BaseMapper 支持 id 为泛型。 BaseMapper 是使用 dao 层数据进行 CRUD只需要进行使用 dao 层接口继承 BaseMapper 接口即可。
Mapper.class
package com.baomidou.mybatisplus.core.mapper;public interface MapperT {
}Mapper.class 为空接口作为顶层 Mapper 只用于说明规范具体看其实现类。
Iservice
Iservice 用于 controller 层通过 service 调用。使用 service 调用进行 CRUD需要使用 service 接口继承 Iservice并且 service 接口的实现类要继承 ServiceImplxxxMapper, pojo。
Mapper 和 Iservice 的区别
Mapper 用于 service 层通过 xxMapper 调用从 Mapper 继承的方法。Iservice 用于 controller 层通过 service 调用从 Iservice 继承的方法。
Mappper 和 Iservice 里面提供的方法都差不多只是Iservice提供了批量操作的实现比如 批量添加、批量修改。
Wrapper
xxMapper 继承 BaseMapper 接口时继承了其中的空方法Wrapper 代码生成器的作用是为了动态向 sql 的 CRUD增删改查语句即装饰从 BaseMapper 继承的 sql 语句Wrapper 就是典型的修饰器模型。