首页 > 其他分享 >基本用法

基本用法

时间:2022-11-01 12:35:11浏览次数:94  
标签:基本 studentMapper private public sid Integer 用法 class

1.pom.xml

<!--    mybatisPlus-->
<dependency>
  <groupId>com.baomidou</groupId>
  <artifactId>mybatis-plus-boot-starter</artifactId>
  <version>2.3</version>
</dependency>

2.实体类

@Data
@TableName("student")
public class Student {
    @TableId(value = "sid", type = IdType.AUTO)
    private Integer sid;

    @TableField("name")
    private String name;
    
    private Integer age;
}

3.mapper

public interface StudentMapper extends BaseMapper<Student> {
}

4.测试类

@SpringBootTest
@RunWith(SpringRunner.class)
public class TestStudent {
    @Resource
    private StudentMapper studentMapper;

    @Test
    public void test(){
        List<Student> list = studentMapper.selectList(null);
        list.forEach(System.out::println);
    }
}

标签:基本,studentMapper,private,public,sid,Integer,用法,class
From: https://www.cnblogs.com/lwx11111/p/16847269.html

相关文章

  • Spring Boot基本操作
    分享知识传递快乐SpringBoot特点:1.创建独立的Spring应用程序,2.嵌入的Tomcat,无需部署WAR文件,3.简化Maven配置,4.自动配置Spring,5.提供生产就绪型功能,如指标,健康......
  • node4_01创建基本的web服务器
    //1.导入http模块consthttp=require("http")//2.创建web服务器实例constserver=http.createServer()//3.为服务器实例绑定request实例,监听客户端的请求server.......
  • node3_path.join和path.basename、path.extname用法
    constpath=require('path')//../会抵消一级路径constpathStr=path.join('/a','/b/c','../','./d','e')console.log(pathStr)//凡是涉及到路径拼接的问题,都要......
  • 注解用法详解——@SuppressWarnings
    作为一名有强迫症的程序员最见不得的事情之一就是程序里有警告出现,还有一大困扰就是在eclipseIDE中,起码前面有警告时会无法加入断点。一般来讲大多数警告是代码不规范或安......
  • Java的基本使用
    两个部分:一是理论、二是实践;这里的Java讲解来源于2010年之前,之后的改变看官网。一、Java的基本概念1Java发展历史由sun(Stanforduniversitynetwork)开发,1982年2月成立,2009年......
  • Matlab神经网络函数newff()新旧用法差异
    在MatlabR2010a版中,如果要创建一个具有两个隐含层、且神经元数分别为5、3的前向BP网络,使用旧的语法可以这样写:        net1=newff(minmax(P),[53 1]);注意......
  • JavaScript中Array.from()方法的用法
    1.介绍作用:将一个伪数组对象或者可迭代的任意对象转换为一个真正的数组语法:Array.from(arrayLike[,mapFunction[,thisArg]])arrayLike:必传参数,指定需要转换为数......
  • 实验一:线性表的存储结构定义及基本操作
    (一)基本实验内容(顺序表):建立顺序表,完成顺序表的基本操作:初始化、插入、删除、逆转、输出、销毁、置空表、求表长、查找元素、判线性表是否为空、实现顺序表元素的逆转......
  • Element基本组件
     Element按钮组件:  <el-row><el-button>默认按钮</el-button><el-buttontype="primary">主要按钮</el-button><el-buttontype="success">成功按钮</el......
  • 堆排序的基本知识
    堆的性质分为大根堆和小根堆,性质为结点的左右孩子大于或小于根节点(1)堆是一颗完全二叉树;(2)小(大)顶堆中的每一个节点都不小于(不大于)它的父节点;(3)堆的插入、删除......